-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.48 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build container images
on:
push:
paths:
- .github/workflows/docker.yml
- '*/Dockerfile'
pull_request:
paths:
- .github/workflows/docker.yml
- '*/Dockerfile'
schedule:
- cron: 0 0 * * 0
workflow_dispatch: null
jobs:
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: [qemu]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: ${{ github.repository_owner == 'ClangBuiltLinux' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set variables
id: variables
run: echo "date=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_OUTPUT
- name: Build
uses: docker/build-push-action@v3
with:
context: ./${{ matrix.image }}
file: ./${{ matrix.image }}/Dockerfile
platforms: linux/amd64
push: ${{ github.repository_owner == 'ClangBuiltLinux' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
tags: |
ghcr.io/clangbuiltlinux/${{ matrix.image }}:${{ steps.variables.outputs.date }}
ghcr.io/clangbuiltlinux/${{ matrix.image }}:latest