-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.27 KB
/
docker-publish.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
name: Build Ostree Container Image
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
- cron: '00 0,8,16 * * *'
push:
branches: [ '*' ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: fedora:latest
options: --privileged
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build
env:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
image: ${{ github.repository }}
tag: ${{ github.ref_name }}
composefile: ${{ vars.COMPOSEFILE }}
run: |
dnf -y install rpm-ostree skopeo selinux-policy-targeted
skopeo login -u $username -p $password $registry
mkdir -p repo cache
ostree init --repo=repo --mode=archive
rpm-ostree compose image --initialize-mode=if-not-exists \
--format registry --layer-repo repo --cachedir=cache \
$composefile \
$registry/$image:$tag