67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["tests"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
REVERB_APP_KEY: ${{ secrets.REVERB_APP_KEY }}
|
|
REVERB_APP_SECRET: ${{ secrets.REVERB_APP_SECRET }}
|
|
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get version
|
|
id: get_version
|
|
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
|
|
|
|
# Required for cross-compiling ARM64 images on x86_64 runners
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.matthiasg.dev
|
|
username: ninluc
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push multi-arch image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
build-args: |
|
|
VITE_REVERB_APP_KEY=${{ secrets.REVERB_APP_KEY }}
|
|
VITE_REVERB_HOST=perceptron.matthiasg.dev
|
|
VITE_REVERB_PORT=443
|
|
VITE_REVERB_SCHEME=https
|
|
tags: |
|
|
git.matthiasg.dev/ninluc/perceptron-viewer/perceptron-viewer:latest
|
|
git.matthiasg.dev/ninluc/perceptron-viewer/perceptron-viewer:${{ steps.get_version.outputs.version }}
|
|
|
|
# notify:
|
|
# needs: build
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
# - name: Notify Watchtower
|
|
# run: "curl -i -X POST -H \"Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}\" https://watchtower.beermaker.matthiasg.dev/v1/update"
|