-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (52 loc) · 1.34 KB
/
mirror.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Mirror Dockerhub
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
mirror:
name: Mirror
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: alpine
repo: docker.io
- image: busybox
repo: docker.io
- image: debian
repo: docker.io
- image: golang
repo: docker.io
- image: mysql
repo: docker.io
- image: node
repo: docker.io
- image: openjdk
repo: docker.io
- image: postgres
repo: docker.io
- image: python
repo: docker.io
- image: rust
repo: docker.io
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: actions/setup-go@v5
- uses: imjasonh/setup-crane@v0.4
- name: Mirror
run: |
for tag in $(cat ./images/${{ matrix.image }}); do
crane copy \
${{ matrix.repo }}/${{ matrix.image }}:$tag \
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:$tag
done