-
Notifications
You must be signed in to change notification settings - Fork 12
39 lines (37 loc) · 1.1 KB
/
mirror-ghcr.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
name: Mirror docker images
on:
repository_dispatch:
types:
- 'mirror-ghcr/*-*-*'
- 'mirrors/*-*-*'
push:
tags:
- '*-*-*'
jobs:
mirror-ghcr:
name: Release on GitHub package
runs-on: ubuntu-latest
steps:
- run:
echo TAG=${GITHUB_REF##*/} >> $GITHUB_ENV
if: github.event_name == 'push'
- run:
echo TAG=${REF##*/} >> $GITHUB_ENV
if: github.event_name == 'repository_dispatch'
env:
REF: ${{ github.event.action }}
- run: |
echo IMAGE=colomoto/colomoto-docker:${TAG} >> $GITHUB_ENV
echo GH_IMAGE=ghcr.io/colomoto/colomoto-docker:${TAG} >> $GITHUB_ENV
- run: docker pull ${IMAGE}
- run: docker tag $IMAGE $GH_IMAGE
- name: Login to GitHub Packages
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.PAT_PACKAGES_USER }}
DOCKER_PASSWORD: ${{ secrets.PAT_PACKAGES }}
DOCKER_REGISTRY_URL: ghcr.io
- name: Push package
uses: actions-hub/docker@master
with:
args: push $GH_IMAGE