Initial commit #2
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: Publish Docker branch image (edge) | |
on: | |
schedule: | |
- cron: '0 0 * * *' # At 00:00 | |
push: | |
branches: | |
- main | |
paths: | |
# Workflow file itself | |
- '.github/workflows/deploy_edge.yml' | |
# Dockerfile | |
- '**/*.dockerfile' | |
workflow_dispatch: | |
permissions: | |
packages: write | |
contents: read | |
jobs: | |
push_to_registry: | |
name: Push Docker branch image (${{matrix.project}}-edge) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
project: | |
- "clang-tidy" | |
- "clang-format" | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ams21/${{ matrix.project }} | |
ghcr.io/ams21/${{ matrix.project }} | |
flavor: | | |
latest=false | |
prefix= | |
suffix= | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=raw,value=edge | |
- name: Docker Setup QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: ./ | |
file: ${{ matrix.project }}.dockerfile | |
build-args: "VERSION=main" | |
push: true | |
platforms: "linux/386,linux/amd64,linux/arm64" | |
annotations: ${{ steps.meta.outputs.annotations }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |