- Updated the build workflow to trigger on version tags (e.g., v1.0.0) pushed to the main branch. - Configured the Docker image to be tagged with the version and pushed to the GitHub Container Registry. - Ensured that the workflow continues to build on pushes to the develop branch and supports manual triggering.
35 lines
No EOL
990 B
YAML
35 lines
No EOL
990 B
YAML
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: 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
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max |