Copy Image #2
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: "Copy Image" | |
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags | |
on: | |
workflow_dispatch: | |
inputs: | |
from: | |
description: 'From tag, such as ubuntu20-cache-23-11-10' | |
required: true | |
type: string | |
to: | |
description: 'To tag, such as ubuntu20-cache-23-11-09' | |
required: true | |
type: string | |
jobs: | |
docker: | |
name: release-docker | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Build envs | |
run: | | |
echo "FROM=${{ inputs.from }}" >> $GITHUB_ENV | |
echo "TO=${{ inputs.to }}" >> $GITHUB_ENV | |
# Docker | |
- name: Login docker hub | |
uses: docker/login-action@v2 | |
with: | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_PASSWORD }}" | |
- name: Copy to docker registry | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/srs:${{ env.FROM }} | |
dst: | | |
ossrs/srs:${{ env.TO }} | |
# Aliyun | |
- name: Login aliyun hub | |
uses: docker/login-action@v2 | |
with: | |
registry: registry.cn-hangzhou.aliyuncs.com | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Copy to Aliyun registry | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/srs:${{ env.FROM }} | |
dst: | | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.TO }} |