Nightly CI #74094
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly CI | |
on: | |
schedule: | |
- cron: "*/30 * * * *" | |
env: | |
NAME: rust | |
REGISTRY_AUTH_FILE: ./auth.json | |
SKOPEO_LATEST: true | |
jobs: | |
copy: | |
strategy: | |
fail-fast: false | |
matrix: | |
registry: ["ghcr.io", "docker.io", "quay.io"] | |
os: | |
- alpine3.20 | |
- alpine3.19 | |
- bookworm | |
- bookworm-slim | |
- bullseye | |
- bullseye-slim | |
include: | |
- os: alpine3.20 | |
tags: | | |
nightly-alpine3.20-<ver> | |
nightly-alpine-<ver> | |
nightly-alpine3.20 | |
nightly-alpine | |
- os: alpine3.19 | |
tags: | | |
nightly-alpine3.19-<ver> | |
nightly-alpine3.19 | |
- os: bookworm | |
tags: | | |
nightly-bookworm-<ver> | |
nightly-<ver> | |
nightly-bookworm | |
nightly | |
- os: bookworm-slim | |
tags: | | |
nightly-bookworm-slim-<ver> | |
nightly-slim-<ver> | |
nightly-bookworm-slim | |
nightly-slim | |
- os: bullseye | |
tags: | | |
nightly-bullseye-<ver> | |
nightly-bullseye | |
- os: bullseye-slim | |
tags: | | |
nightly-bullseye-slim-<ver> | |
nightly-bullseye-slim | |
runs-on: ubuntu-latest | |
steps: | |
# Skip if this is fork and no credentials are provided. | |
- id: skip | |
run: echo "no=${{ !( | |
github.repository_owner != 'instrumentisto' | |
&& ((matrix.registry == 'quay.io' | |
&& secrets.QUAYIO_ROBOT_USER == '') | |
|| (matrix.registry == 'docker.io' | |
&& secrets.DOCKERHUB_BOT_USER == '')) | |
) }}" >> $GITHUB_OUTPUT | |
- name: Install latest version of `skopeo` | |
run: | | |
sudo apt remove skopeo | |
sudo apt update | |
sudo apt install \ | |
go-md2man pkg-config \ | |
libassuan-dev libbtrfs-dev libdevmapper-dev libgpgme-dev | |
git clone https://github.com/containers/skopeo \ | |
$GOPATH/src/github.com/containers/skopeo | |
cd $GOPATH/src/github.com/containers/skopeo/ | |
make bin/skopeo | |
sudo make install | |
env: | |
DISABLE_DOCS: 1 | |
GOPATH: /home/runner/go | |
if: ${{ steps.skip.outputs.no == 'true' | |
&& env.SKOPEO_LATEST == 'true' }} | |
- uses: actions/checkout@v4 | |
if: ${{ steps.skip.outputs.no == 'true' }} | |
- name: Check upstream manifests changed | |
id: upstream | |
run: | | |
result=$(bash nightly/check-changed.sh 2>&1) | |
echo "$result" | |
echo 'result<<EOF'$'\n'"$result"$'\n'EOF >> $GITHUB_OUTPUT | |
env: | |
IMAGE: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ env.NAME }} | |
IMAGE_OS: ${{ matrix.os }} | |
if: ${{ steps.skip.outputs.no == 'true' }} | |
- name: Login to ${{ matrix.registry }} container registry | |
run: skopeo login --username='${{ (matrix.registry == 'docker.io' | |
&& secrets.DOCKERHUB_BOT_USER) | |
|| (matrix.registry == 'quay.io' | |
&& secrets.QUAYIO_ROBOT_USER) | |
|| github.repository_owner }}' | |
--password='${{ (matrix.registry == 'docker.io' | |
&& secrets.DOCKERHUB_BOT_PASS) | |
|| (matrix.registry == 'quay.io' | |
&& secrets.QUAYIO_ROBOT_TOKEN) | |
|| secrets.GITHUB_TOKEN }}' | |
${{ matrix.registry }} | |
if: ${{ steps.skip.outputs.no == 'true' | |
&& contains(steps.upstream.outputs.result, 'CHANGED') }} | |
- name: Copy image | |
run: bash nightly/copy.sh | |
env: | |
IMAGE: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ env.NAME }} | |
IMAGE_OS: ${{ matrix.os }} | |
IMAGE_TAGS: ${{ matrix.tags }} | |
if: ${{ steps.skip.outputs.no == 'true' | |
&& contains(steps.upstream.outputs.result, 'CHANGED') }} | |
- name: Logout from ${{ matrix.registry }} container registry | |
run: skopeo logout ${{ matrix.registry }} | |
if: ${{ always() | |
&& steps.skip.outputs.no == 'true' | |
&& contains(steps.upstream.outputs.result, 'CHANGED') }} |