Image Sync #95
This file contains hidden or 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: Image Sync | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| image: | |
| description: 'image to be synced' | |
| required: false | |
| type: string | |
| platform: | |
| description: 'platform of image, default is all (amd64, arm64, all)' | |
| required: false | |
| type: string | |
| jobs: | |
| image-sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Login Docker Hub | |
| env: | |
| PASSWORD: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | |
| USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| run: docker login --username ${USERNAME} --password ${PASSWORD} | |
| - name: sync | |
| env: | |
| ACR_TOKEN: ${{ secrets.ACR_TOKEN }} | |
| ACR_USERNAME: ${{ secrets.ACR_USERNAME }} | |
| run: | | |
| set -e | |
| cd ${GITHUB_WORKSPACE}/.github/scripts/ | |
| platform=${{ inputs.platform }} | |
| if [ -z "$platform" ]; then | |
| platform="all" | |
| fi | |
| if [ ${{ inputs.image }} ]; then | |
| ./sync.sh ${{ inputs.image }} $platform | |
| else | |
| echo "No image to sync" | |
| fi | |
| - name: Setup upterm session | |
| if: ${{ failure() }} | |
| timeout-minutes: 60 | |
| uses: lhotari/action-upterm@v1 |