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 + })