Docker Image CI - Dev #52
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: Docker Image CI - Dev | |
on: | |
schedule: | |
- cron: "0 10 * * *" | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/arm/v7,linux/arm64/v8 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: https://ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/${{github.repository}} | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
# set dev tag for default branch | |
type=raw,value=dev,enable={{is_default_branch}} | |
type=schedule,pattern=nightly | |
type=sha | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/arm/v7,linux/arm64/v8 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=ghcr.io/${{github.repository}}:latest | |
cache-to: type=inline |