Sync golang image from docker to ghcr #830
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Sync golang image from docker to ghcr' | |
on: | |
schedule: | |
- cron: '30 1 * * *' | |
push: | |
branches: | |
- master | |
env: | |
GOLANG_VERSION: 1.18 | |
jobs: | |
sync-golang: | |
name: 'sync' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v1 | |
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 }} |