diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 134a6b5..facb161 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,14 +22,21 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set Docker tags + id: docker_meta + run: | + if [[ $GITHUB_REF == refs/heads/develop ]]; then + echo "tags=ghcr.io/pridevrinc/vrcauthproxy:latest" >> $GITHUB_OUTPUT + elif [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + echo "tags=ghcr.io/pridevrinc/vrcauthproxy:${VERSION},ghcr.io/pridevrinc/vrcauthproxy:latest" >> $GITHUB_OUTPUT + fi - name: Build and push uses: docker/build-push-action@v5 with: push: true file: ./Dockerfile platforms: linux/amd64 - tags: | - ghcr.io/pridevrinc/vrcauthproxy:latest - ghcr.io/pridevrinc/vrcauthproxy:${{ github.ref }} # Push the tagged version + tags: ${{ steps.docker_meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max \ No newline at end of file