Skip to content

hub.docker.com -> us-docker.pkg.dev #69

hub.docker.com -> us-docker.pkg.dev

hub.docker.com -> us-docker.pkg.dev #69

Workflow file for this run

name: hub.docker.com -> us-docker.pkg.dev
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
jobs:
sync-images:
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Authenticate to Google Cloud
id: 'auth'
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2
with:
workload_identity_provider: ${{ secrets.GCLOUD_OIDC_POOL }}
service_account: ${{ secrets.GSA }}
token_format: 'access_token'
- uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
name: 'Docker login'
with:
registry: 'us-docker.pkg.dev'
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
- name: pull+push
run: |
REPOS=$(curl -s "https://hub.docker.com/v2/repositories/lehighlts/?page_size=100" | \
jq -r '.results[] | select(.name | startswith("scyllaridae-")) | .name')
for REPO in $REPOS; do
SOURCE="lehighlts/$REPO:main"
TARGET="us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/shared/$REPO:main"
docker pull "$SOURCE"
docker tag "$SOURCE" "$TARGET"
docker push "$TARGET"
done
docker pull islandora/fits:main
docker tag islandora/fits:main us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/shared/harvard-fits:main
docker push us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/shared/harvard-fits:main
- name: ⛴️
run: gh workflow run apply.yml
env:
GH_TOKEN: ${{ secrets.GH_WORKFLOW_TOKEN }}