Skip to content

chore: update the images only during Sunday #2388

chore: update the images only during Sunday

chore: update the images only during Sunday #2388

Workflow file for this run

name: Continuous Integration
on:
push:
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
env:
IMAGE_NAME: docker-postgresql
jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-22.04
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
steps:
- uses: actions/checkout@v4
- id: generate-jobs
name: Generate Jobs
run: .github/generate-strategy.sh
test:
needs: generate-jobs
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
name: PostgreSQL ${{ matrix.name }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
run: |
git clone --depth 1 https://github.com/docker-library/official-images.git -b master ~/oi
# create a dummy empty image/layer so we can --filter since= later to get a meaningful image list
{ echo FROM busybox:latest; echo RUN :; } | docker build --no-cache --tag image-list-marker -
# PGP Happy Eyeballs
git clone --depth 1 https://github.com/tianon/pgp-happy-eyeballs.git ~/phe
~/phe/hack-my-builds.sh
rm -rf ~/phe
- name: Docker meta
env:
TAGS: ${{ toJson(matrix.tags) }}
run: |
RESULT=""
for tag in $(jq -r '.[]' <<< "${TAGS}")
do
RESULT="${RESULT},${IMAGE_NAME}:${tag}"
done
echo "TAGS=${RESULT%,}" >> $GITHUB_ENV
- name: Build ${{ matrix.name }}
uses: docker/build-push-action@v6
with:
context: ${{ matrix.dir }}
file: ${{ matrix.file }}
secrets: |
"cs_token=${{ secrets.CS_TOKEN }}"
"subscription=${{ secrets.SUBSCRIPTION }}"
push: false
provenance: false
tags: ${{ env.TAGS }}
load: true
build-args: |
SUBSCRIPTION_NAME=docker-postgresql-ci-${{ github.run_number }}
- name: History ${{ matrix.name }}
run: docker history "${IMAGE_NAME}:${{ matrix.tags[0] }}"
- name: Test ${{ matrix.name }}
run: ~/oi/test/run.sh "${IMAGE_NAME}:${{ matrix.tags[0] }}"
- name: '"docker images"'
run: docker image ls --filter since=image-list-marker
- name: docker images labels
run: docker image ls --filter since=image-list-marker --format "{{.Repository}}:{{.Tag}}" | xargs docker inspect | jq -r '.[] | "\(.RepoTags[]) \(.Config.Labels)"'
check:
if: always()
needs:
- generate-jobs
- test
name: Check
runs-on: ubuntu-22.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}