-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (59 loc) · 2.04 KB
/
build-base-image.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build Base Image
on:
schedule:
# Every Monday at 6:22am Eastern Time
- cron: '22 10 * * 1'
workflow_dispatch:
# Allow us to manually trigger build
concurrency:
# This concurrency group is used to prevent multiple builds from running at the same time.
group: build-base-${{ github.ref_name }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
docker-build-baseimage:
name: Build Base Image
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
# See comment here: https://github.com/actions/runner-images/issues/1187#issuecomment-686735760
- name: Disable network offload
run: sudo ethtool -K eth0 tx off rx off
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate tags for image
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/circ-baseimage
# Generate tags for the image
# We use the following tags:
# - The date in YYYYww format, which is the year and week number. 202052 is the last week of 2020.
# - The latest tag
tags: |
type=schedule,pattern={{date 'YYYYww'}}
type=raw,value=latest
- name: Build base image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile.baseimage
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
target: baseimage
cache-to: type=inline
platforms: linux/amd64, linux/arm64