name: Build Docker Image on: push: branches: - develop tags: - 'v*' # This will trigger the workflow for version tags like v1.0.0 workflow_dispatch: jobs: docker: runs-on: ubuntu-latest steps: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: 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: ${{ steps.docker_meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max