Stable CI #47164
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: Stable CI | |
on: | |
schedule: | |
- cron: "7 */12 * * *" | |
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 | |
- slim-bookworm | |
- bullseye | |
- slim-bullseye | |
include: | |
- os: alpine3.20 | |
tags: | | |
<full-ver>-alpine3.20 | |
<full-ver>-alpine | |
<minor-ver>-alpine3.20 | |
<minor-ver>-alpine | |
<major-ver>-alpine3.20 | |
<major-ver>-alpine | |
alpine3.20 | |
alpine | |
- os: alpine3.19 | |
tags: | | |
<full-ver>-alpine3.19 | |
<minor-ver>-alpine3.19 | |
<major-ver>-alpine3.19 | |
alpine3.19 | |
- os: bookworm | |
tags: | | |
<full-ver>-bookworm | |
<full-ver> | |
<minor-ver>-bookworm | |
<minor-ver> | |
<major-ver>-bookworm | |
<major-ver> | |
bookworm | |
latest | |
- os: slim-bookworm | |
tags: | | |
<full-ver>-slim-bookworm | |
<full-ver>-slim | |
<minor-ver>-slim-bookworm | |
<minor-ver>-slim | |
<major-ver>-slim-bookworm | |
<major-ver>-slim | |
slim-bookworm | |
slim | |
- os: bullseye | |
tags: | | |
<full-ver>-bullseye | |
<minor-ver>-bullseye | |
<major-ver>-bullseye | |
bullseye | |
- os: slim-bullseye | |
tags: | | |
<full-ver>-slim-bullseye | |
<minor-ver>-slim-bullseye | |
<major-ver>-slim-bullseye | |
slim-bullseye | |
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 stable/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 stable/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') }} |