Skip to content

ci(Update build.yml): 💚 #29

ci(Update build.yml): 💚

ci(Update build.yml): 💚 #29

Workflow file for this run

name: Build Docker Image
on:
push:
branches:
- "develop"
- "master"
tags:
- "*"
paths-ignore:
- "assets/**"
- "data/**"
- "systemd/**"
- "README.md"
- "renovate.json"
pull_request:
branches:
- "develop"
paths-ignore:
- "assets/**"
- "data/**"
- "systemd/**"
- "README.md"
- "renovate.json"
jobs:
build-and-push-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: buildx
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/thezak48/varken
flavor: |
latest=auto
tags: |
type=raw,value=${{ github.ref == 'refs/heads/master' && 'latest' || 'develop' }},enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=pr
type=sha
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_ZAK }}
- name: Docker build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event.pull_request.head.repo.full_name == 'thezak48/varken' || github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
VCS_REF=${{ github.sha }}
VERSION=${{ steps.meta.outputs.tags }}