Skip to content

Rebuild the ubuntu20. #391

Rebuild the ubuntu20.

Rebuild the ubuntu20. #391

Workflow file for this run

name: "Release"
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
on:
push:
branches:
- 'ubuntu20'
jobs:
envs:
steps:
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
- uses: dorny/paths-filter@v2
id: filter
with:
base: 'ubuntu20'
filters: |
base: 'Dockerfile.base'
base2: ['Dockerfile.base', 'Dockerfile.base2']
base3: ['Dockerfile.base', 'Dockerfile.base2', 'Dockerfile.base3']
base4: ['Dockerfile.base', 'Dockerfile.base2', 'Dockerfile.base3', 'Dockerfile.base4']
base50: ['Dockerfile.base', 'Dockerfile.base2', 'Dockerfile.base3', 'Dockerfile.base50']
base51: ['Dockerfile.base', 'Dockerfile.base2', 'Dockerfile.base3', 'Dockerfile.base51']
base999999: ['Dockerfile.base', 'Dockerfile.base2', 'Dockerfile.base3', 'Dockerfile.base4', 'Dockerfile.base50', 'Dockerfile.base51', 'Dockerfile.base999999']
################################################################
# The github.ref is, for example, refs/tags/v5.0.145 or refs/tags/v5.0-r8
# Generate variables like:
# SRS_TAG=v5.0-r8
# SRS_TAG=v5.0.145
# @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
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
base: ${{ steps.filter.outputs.base }}
base2: ${{ steps.filter.outputs.base2 }}
base3: ${{ steps.filter.outputs.base3 }}
base4: ${{ steps.filter.outputs.base4 }}
base50: ${{ steps.filter.outputs.base50 }}
base51: ${{ steps.filter.outputs.base51 }}
base999999: ${{ steps.filter.outputs.base999999 }}
SRS_TAG: ${{ env.SRS_TAG }}
runs-on: ubuntu-20.04
docker-base:
needs:
- envs
if: ${{ always() && needs.envs.outputs.base == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base \
-f Dockerfile.base .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base
runs-on: ubuntu-20.04
docker-base2:
needs:
- docker-base
- envs
if: ${{ always() && needs.envs.outputs.base2 == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base2 \
-f Dockerfile.base2 .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base2
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base2
runs-on: ubuntu-20.04
docker-base3:
needs:
- docker-base2
- envs
if: ${{ always() && needs.envs.outputs.base3 == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base3 \
-f Dockerfile.base3 .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base3
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base3
runs-on: ubuntu-20.04
docker-base4:
needs:
- docker-base3
- envs
if: ${{ always() && needs.envs.outputs.base4 == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base4 \
-f Dockerfile.base4 .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base4
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base4
runs-on: ubuntu-20.04
docker-base50:
needs:
- docker-base3
- envs
if: ${{ always() && needs.envs.outputs.base50 == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base50 \
-f Dockerfile.base50 .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base50
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base50
runs-on: ubuntu-20.04
docker-base51:
needs:
- docker-base3
- envs
if: ${{ always() && needs.envs.outputs.base51 == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base51 \
-f Dockerfile.base51 .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base51
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base51
runs-on: ubuntu-20.04
docker-base999999:
needs:
- docker-base4
- docker-base50
- docker-base51
- envs
if: ${{ always() && needs.envs.outputs.base999999 == 'true' }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
- name: Remove unnecessary files
run: |
df -h
echo ""
echo "After removed some unused files."
echo ""
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/lib/jvm
df -h
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:${SRS_TAG}-base999999 \
-f Dockerfile.base999999 .
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}-base999999
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}-base999999
runs-on: ubuntu-20.04
docker-prod:
needs:
- envs
- docker-base999999
if: ${{ always() }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_TAG_DATE=${{ needs.envs.outputs.SRS_TAG }}-$(date +%y-%m-%d)" >> $GITHUB_ENV
################################################################
- name: Checkout repository
uses: actions/checkout@v3
################################################################
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
################################################################
- name: Login docker hub
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push to docker registry
run: |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:$SRS_TAG .
- name: Copy to docker registry
uses: akhilerm/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}
dst: |
ossrs/srs:${{ env.SRS_TAG_DATE }}
runs-on: ubuntu-20.04
docker-aliyun:
needs:
- envs
- docker-prod
if: ${{ always() }}
steps:
################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_TAG_DATE=${{ needs.envs.outputs.SRS_TAG }}-$(date +%y-%m-%d)" >> $GITHUB_ENV
################################################################
- 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/tag-push-action@v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG_DATE }}
runs-on: ubuntu-20.04