From 75d945aeccff9e39358f64aa5dfcc5cf0ec8b9e3 Mon Sep 17 00:00:00 2001 From: Karuboniru Date: Mon, 22 Jan 2024 21:31:07 +0000 Subject: [PATCH] Use GitHub Action to build image --- .github/workflows/docker-publish.yml | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..0eb7fdf --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,47 @@ +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 9 * * *' + push: + branches: [ '*' ] + + +jobs: + build: + runs-on: ubuntu-latest + container: + image: fedora:latest + options: --privileged + permissions: + contents: read + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build + env: + registry: ${{ vars.REGISTRY }} + username: ${{ vars.QUAY_USER }} + password: ${{ secrets.QUAY_PASSWORD }} + image: ${{ vars.IMAGE_NAME }} + tag: ${{ github.ref_name }} + composefile: ${{ vars.COMPOSEFILE }} + run: | + dnf -y install podman rpm-ostree git skopeo buildah 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 + + \ No newline at end of file