Create sync-image-example.yml #1
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 Image to Aliyun Example | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git pull | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to Docker Hub | |
uses: docker/[email protected] | |
with: | |
registry: registry.cn-guangzhou.aliyuncs.com | |
username: ${{vars.DOCKER_USERNAME}} | |
password: ${{vars.DOCKER_PASSWORD}} | |
logout: false | |
- name: Use Skopeo Tools Sync Image to Docker Hub | |
run: | | |
skopeo copy docker://docker.io/userxy2015/ngnix:latest docker://registry.cn-guangzhou.aliyuncs.com/gorgor1065/ngnix:latest | |