|
name: Build & Push Cabernet |
|
|
|
on: |
|
push: |
|
|
|
branches: |
|
- master |
|
- dev |
|
|
|
|
|
tags: |
|
- v* |
|
|
|
|
|
pull_request: |
|
|
|
jobs: |
|
|
|
|
|
docker-image: |
|
runs-on: ubuntu-latest |
|
permissions: |
|
packages: write |
|
contents: read |
|
|
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@v4 |
|
|
|
- name: Set up QEMU |
|
uses: docker/setup-qemu-action@v3 |
|
|
|
- name: Set up Docker Buildx |
|
uses: docker/setup-buildx-action@v3 |
|
|
|
- name: Docker meta |
|
id: meta |
|
uses: docker/metadata-action@v5 |
|
with: |
|
images: ghcr.io/${{ github.repository }} |
|
tags: | |
|
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} |
|
type=ref,event=branch |
|
type=semver,pattern={{version}} |
|
type=ref,event=pr |
|
|
|
- name: Login to GHCR |
|
if: github.event_name != 'pull_request' |
|
uses: docker/login-action@v1 |
|
with: |
|
registry: ghcr.io |
|
username: ${{ github.repository_owner }} |
|
password: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
- name: Build and push |
|
uses: docker/build-push-action@v5 |
|
with: |
|
context: . |
|
platforms: linux/amd64,linux/arm64 |
|
push: ${{ github.event_name != 'pull_request' }} |
|
tags: ${{ steps.meta.outputs.tags }} |
|
labels: ${{ steps.meta.outputs.labels }} |
|
|