-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (50 loc) · 1.78 KB
/
build.yaml
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
name: Build
on:
schedule:
- cron: "15 9 6,13,20,27 * *"
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
# As-is, this fails due to "No space left on device" when run on GitHub's default runner;
# so set-up self-hosted on https://github.com/vorburger/vorburger-dotfiles-bin-etc/settings/actions/runners.
# runs-on: ubuntu-latest
runs-on: self-hosted
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Set up BuildKit Docker container builder to be able to build multi-platform images and export cache
- name: Set up Docker Buildx
uses: docker/[email protected]
# Login against a Docker registry
- name: Log into registry ${{ env.REGISTRY }}
if: ${{ github.event_name != 'pull_request' }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Run Containers build (required BEFORE subsequent docker build -f Dockerfile-fedora)
- name: Build containers
run: container/build.sh
- name: Push container image
if: ${{ github.event_name != 'pull_request' }}
run: docker push ghcr.io/vorburger/dotfiles-fedora