Build #166
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
schedule: | |
- cron: "0 5 * * 1" | |
workflow_call: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-image: | |
name: Build images and push to registry | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Create new buildx builder | |
uses: docker/setup-buildx-action@v3 | |
- name: Generate app image tags | |
uses: docker/metadata-action@v5 | |
id: meta-app | |
with: | |
bake-target: app-production | |
images: | | |
ghcr.io/${{ github.repository }}-app | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Generate web image tags | |
uses: docker/metadata-action@v5 | |
id: meta-web | |
with: | |
bake-target: web-production | |
images: | | |
ghcr.io/${{ github.repository }}-web | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Generate grafana image tags | |
uses: docker/metadata-action@v5 | |
id: meta-grafana | |
with: | |
bake-target: grafana-production | |
images: | | |
ghcr.io/${{ github.repository }}-grafana | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Login to Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- uses: docker/[email protected] | |
with: | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta-app.outputs.bake-file }} | |
${{ steps.meta-web.outputs.bake-file }} | |
${{ steps.meta-grafana.outputs.bake-file }} | |
set: | | |
*.cache-to=type=gha,mode=max | |
*.cache-from=type=gha | |
push: true |