From 4d0c53958eb930fa4f2f314fe917c3c744d8d499 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 5 Dec 2024 17:56:17 +0000 Subject: [PATCH] Create 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 7bb1f86..a869408 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,6 +50,17 @@ 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 + }) update-ds-infrastructure-web: runs-on: ubuntu-latest