From cd183c042868e6b3e3c7fae88c3203ca86156e05 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 5 Dec 2024 17:43:40 +0000 Subject: [PATCH] Add tag on build --- .github/workflows/cd.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8449d84..b5e3bc8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -40,7 +40,7 @@ jobs: - version permissions: packages: write - contents: read + contents: write steps: - uses: actions/checkout@v4 - name: Build Docker image @@ -50,3 +50,14 @@ jobs: latest: ${{ github.ref == 'refs/heads/main' }} github-token: ${{ secrets.GITHUB_TOKEN }} docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }} + - name: Create tag + if: github.ref == 'refs/heads/main' + uses: actions/github-script@v5 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/v${{ needs.version.outputs.version }}', + sha: context.sha + })