archery/.github/workflows/build-arch-images.yml

68 lines
1.6 KiB
YAML

name: Docker Image CI
on:
workflow_dispatch:
branches: [ master ]
push:
branches: [ master ]
paths: [ docker/*, docker/scripts/* ]
pull_request:
branches: [ master ]
paths: [ docker/* ]
schedule:
- cron: '0 5 * * 4'
jobs:
build_arch_images:
name: Build build images
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
images:
[
arch,
artix
]
env:
ABSOLUTE_DH_IMAGE: docker.io/corysanin/archy-build-thing
DEPLOY: false
permissions:
contents: read
packages: write
steps:
- name: determine deployment
if: github.ref == 'refs/heads/master' && ( github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' )
run: echo "DEPLOY=true" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Log in to the Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v6
with:
push: ${{ env.DEPLOY }}
pull: true
no-cache: true
context: ./docker/
file: ./docker/Dockerfile.${{ matrix.images }}
tags: "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}"