forked from rblaine95/dockerhub-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 1.55 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
55
56
57
58
59
60
61
62
63
name: Mirror Dockerhub
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
branches:
- master
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: curl
repo: docker.io/curlimages
- image: debian
repo: docker.io
- image: docker
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
- image: ubuntu
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/[email protected]
- 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