Skip to content

Commit 32bf3c2

Browse files
committed
Git tag releases
1 parent 3b9f473 commit 32bf3c2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/main.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ jobs:
5151
tag="v${{ steps.playwright_version.outputs.version }}-${{ steps.distro.outputs.distro }}"
5252
echo "tag=$tag" >> $GITHUB_OUTPUT
5353
54+
- name: Set Git tag
55+
if: github.ref == 'refs/heads/main'
56+
id: git_tag
57+
run: |
58+
COMMIT_SHA=${GITHUB_SHA::7}
59+
GIT_TAG="${{ steps.tag.outputs.tag }}-${COMMIT_SHA}"
60+
echo "tag=$TAG" >> $GITHUB_OUTPUT
61+
5462
- name: Build image
5563
id: build
5664
uses: docker/build-push-action@v4
@@ -66,12 +74,24 @@ jobs:
6674
docker run --rm serenity-js:latest node --version
6775
docker run --rm serenity-js:latest java --version
6876
docker run --rm serenity-js:latest google-chrome --version
69-
docker run --rm serenity-js:latest microsoft-edge --version
77+
docker run --rm serenity-js:latest microsoft-edge --version
7078
71-
- name: Push image if tests pass
79+
- name: Push image
7280
if: success() && github.ref == 'refs/heads/main'
7381
uses: docker/build-push-action@v4
7482
with:
7583
context: .
7684
push: true
7785
tags: ghcr.io/serenity-js/playwright:${{ steps.tag.outputs.tag }}
86+
87+
- name: Push Git tag
88+
if: success()
89+
env:
90+
TAG_NAME: ${{ steps.git_tag.outputs.tag }}
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
run: |
93+
echo "Creating Git tag $TAG_NAME"
94+
git config --global user.name "github-actions[bot]"
95+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
96+
git tag $TAG_NAME
97+
git push origin $TAG_NAME

0 commit comments

Comments
 (0)