2022-06-16 07:43:01 -05:00
|
|
|
name: 'Sync golang image from docker to ghcr'
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '30 1 * * *'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2022-07-16 18:22:38 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2022-07-27 01:13:43 -05:00
|
|
|
packages: write
|
2022-07-16 18:22:38 -05:00
|
|
|
|
2022-06-16 07:43:01 -05:00
|
|
|
jobs:
|
|
|
|
sync-golang:
|
|
|
|
name: 'sync'
|
2022-09-27 13:31:54 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
golang_version:
|
|
|
|
- 1.18
|
|
|
|
- 1.19
|
2022-06-16 07:43:01 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Log in to GitHub Docker Registry
|
2022-07-25 13:11:19 -05:00
|
|
|
uses: docker/login-action@v2
|
2022-06-16 07:43:01 -05:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Tag and push golang to ghcr
|
|
|
|
run: |
|
2022-09-27 13:31:54 -05:00
|
|
|
docker trust inspect golang:${{ matrix.golang_version }}
|
|
|
|
docker pull golang:${{ matrix.golang_version }}
|
|
|
|
docker tag golang:${{ matrix.golang_version }} ghcr.io/${{ github.repository_owner }}/golang:${{ matrix.golang_version }}
|
|
|
|
docker push ghcr.io/${{ github.repository_owner }}/golang:${{ matrix.golang_version }}
|