Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Aug 30, 2023
1 parent 743495f commit b4fe882
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
workflow_run:
workflows: ['Trigger Build']
types: [completed]

permissions:
contents: read
packages: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch date
id: date
run: echo "DATE=$(date '+%Y%m%d')" >> "$GITHUB_OUTPUT"
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64 # TODO: 32-bit (linux/arm/v7 and linux/386)
push: true # TODO: Only push on main
tags: ghcr.io/fwcd/docker-archlinux:latest,ghcr.io/fwcd/docker-archlinux:${{ steps.date.outputs.DATE }}
25 changes: 25 additions & 0 deletions .github/workflows/trigger-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Trigger Build

on:
# Run every day at 07:20 (to avoid the peak times)
schedule:
- cron: '20 7 * * *'
workflow_dispatch:

permissions:
contents: write

jobs:
trigger-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Configure Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create dummy commit
run: git commit --allow-empty -m "Trigger build ($(date -I))"
- name: Push
run: git push
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Docker images of Arch Linux

Unofficial Docker multi-platform images of Arch Linux, Arch Linux ARM and Arch Linux 32.
[![Build and Deploy](https://github.com/fwcd/docker-archlinux/actions/workflows/build-deploy.yml/badge.svg)](https://github.com/fwcd/docker-archlinux/actions/workflows/build-deploy.yml)

Unofficial, automated Docker multi-platform images of Arch Linux for the following architectures:

| Architecture | Docker Platform | Distribution |
| ------------ | --------------- | ------------ |
| x86_64 | `linux/amd64` | [Arch Linux](https://archlinux.org) |
| aarch64 | `linux/arm64` | [Arch Linux ARM](https://archlinuxarm.org) |

0 comments on commit b4fe882

Please sign in to comment.