Create the path for pv. #25
Workflow file for this run
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: "Release docker image for srs-helm" | |
on: | |
push: | |
tags: | |
- v1* | |
jobs: | |
envs: | |
name: envs | |
steps: | |
################################################################################################################## | |
# Git checkout | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# The github.ref is, for example, refs/tags/v1.0.52 | |
# Generate variables like: | |
# SRS_TAG=v1.0.52 | |
# SRS_MAJOR=1 | |
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable | |
- name: Generate varaiables | |
run: | | |
SRS_TAG=$(echo ${{ github.ref }}| awk -F '/' '{print $3}') | |
echo "SRS_TAG=$SRS_TAG" >> $GITHUB_ENV | |
SRS_MAJOR=$(echo $SRS_TAG| awk -F '.' '{print $1}' |sed 's/-v/-/g') | |
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV | |
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs | |
outputs: | |
SRS_TAG: ${{ env.SRS_TAG }} | |
SRS_MAJOR: ${{ env.SRS_MAJOR }} | |
runs-on: ubuntu-20.04 | |
docker: | |
needs: | |
- envs | |
steps: | |
- name: Covert output to env | |
run: | | |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV | |
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV | |
# Git checkout | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Create main images for Docker | |
- name: Login to docker hub | |
uses: docker/login-action@v2 | |
with: | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_PASSWORD }}" | |
- name: Install helm3 | |
run: | | |
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
- name: Build SRS docker image | |
run: | | |
echo "Release ossrs/helm:$SRS_TAG" | |
docker build -t ossrs/helm:$SRS_TAG --build-arg GEM_MIRROR=no -f Dockerfile . | |
docker push ossrs/helm:$SRS_TAG | |
- name: Docker alias images for ossrs/helm | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/helm:${{ env.SRS_TAG }} | |
dst: | | |
ossrs/helm:${{ env.SRS_MAJOR }} | |
ossrs/helm:latest | |
runs-on: ubuntu-20.04 | |
aliyun: | |
needs: | |
- envs | |
- docker | |
steps: | |
- name: Covert output to env | |
run: | | |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV | |
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV | |
# Aliyun ACR | |
- name: Login Aliyun docker hub | |
uses: docker/login-action@v2 | |
with: | |
registry: registry.cn-hangzhou.aliyuncs.com | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Docker alias images for ossrs/helm | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/helm:${{ env.SRS_TAG }} | |
dst: | | |
registry.cn-hangzhou.aliyuncs.com/ossrs/helm:${{ env.SRS_TAG }} | |
registry.cn-hangzhou.aliyuncs.com/ossrs/helm:${{ env.SRS_MAJOR }} | |
registry.cn-hangzhou.aliyuncs.com/ossrs/helm:latest | |
runs-on: ubuntu-20.04 |