diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e56dfe8..d4a2807 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,6 +7,8 @@ on: jobs: build: + permissions: + contents: write runs-on: ubuntu-latest steps: @@ -19,13 +21,17 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Extract version from tag + id: extract_version + run: echo "version=${GITHUB_REF##refs/tags/v}" >> $GITHUB_ENV + - name: Build and push uses: docker/build-push-action@v6 with: push: true tags: | ${{ secrets.DOCKER_USERNAME }}/npm-cert-syncer:latest - ${{ secrets.DOCKER_USERNAME }}/npm-cert-syncer:${{ github.ref_name }} + ${{ secrets.DOCKER_USERNAME }}/npm-cert-syncer:${{ env.version }} - name: Create GitHub Release uses: actions/create-release@v1