2022-06-16 07:43:01 -05:00
|
|
|
name: 'Sync golang image from docker to ghcr'
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '30 1 * * *'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
env:
|
|
|
|
GOLANG_VERSION: 1.18
|
|
|
|
|
2022-07-16 18:22:38 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2022-07-26 09:05:37 -05:00
|
|
|
packages: read|write
|
2022-07-16 18:22:38 -05:00
|
|
|
|
2022-06-16 07:43:01 -05:00
|
|
|
jobs:
|
|
|
|
sync-golang:
|
|
|
|
name: 'sync'
|
|
|
|
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: |
|
|
|
|
docker pull golang:${{ env.GOLANG_VERSION }}
|
|
|
|
docker tag golang:${{ env.GOLANG_VERSION }} ghcr.io/${{ github.repository_owner }}/golang:${{ env.GOLANG_VERSION }}
|
|
|
|
docker push ghcr.io/${{ github.repository_owner }}/golang:${{ env.GOLANG_VERSION }}
|