Nginx Image for HLS CDN #7
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: "Nginx Image for HLS CDN" | |
on: | |
workflow_dispatch: | |
jobs: | |
envs: | |
name: envs | |
steps: | |
- name: Generate varaiables | |
run: | | |
SRS_MAJOR_HTTP=nginx-hls-cdn-http | |
SRS_MAJOR_HTTPS=nginx-hls-cdn-https | |
SRS_VERSION=v1.0.2 | |
echo "SRS_MAJOR_HTTP=$SRS_MAJOR_HTTP" >> $GITHUB_ENV | |
echo "SRS_MAJOR_HTTPS=$SRS_MAJOR_HTTPS" >> $GITHUB_ENV | |
echo "SRS_VERSION=$SRS_VERSION" >> $GITHUB_ENV | |
outputs: | |
SRS_VERSION: ${{ env.SRS_VERSION }} | |
SRS_MAJOR_HTTP: ${{ env.SRS_MAJOR_HTTP }} | |
SRS_MAJOR_HTTPS: ${{ env.SRS_MAJOR_HTTPS }} | |
runs-on: ubuntu-20.04 | |
docker: | |
needs: | |
- envs | |
steps: | |
- name: Covert output to env | |
run: | | |
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV | |
echo "SRS_MAJOR_HTTP=${{ needs.envs.outputs.SRS_MAJOR_HTTP }}" >> $GITHUB_ENV | |
echo "SRS_MAJOR_HTTPS=${{ needs.envs.outputs.SRS_MAJOR_HTTPS }}" >> $GITHUB_ENV | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to docker hub | |
uses: docker/login-action@v2 | |
with: | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_PASSWORD }}" | |
- name: Build HTTP docker image | |
run: | | |
echo "Release ossrs/srs-stack:$SRS_MAJOR_HTTP-$SRS_VERSION" | |
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \ | |
--output "type=image,push=true" \ | |
--tag ossrs/srs-stack:$SRS_MAJOR_HTTP \ | |
-f scripts/nginx-hls-cdn/Dockerfile.http \ | |
scripts/nginx-hls-cdn | |
- name: Alias HTTP docker image | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/srs-stack:${{ env.SRS_MAJOR_HTTP }} | |
dst: | | |
ossrs/srs-stack:${{ env.SRS_MAJOR_HTTP }}-${{ env.SRS_VERSION }} | |
ossrs/srs-stack:nginx-hls-cdn-${{ env.SRS_VERSION }} | |
ossrs/srs-stack:nginx-hls-cdn | |
- name: Build HTTPS docker image | |
run: | | |
echo "Release ossrs/srs-stack:$SRS_MAJOR_HTTPS-$SRS_VERSION" | |
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \ | |
--output "type=image,push=true" \ | |
--tag ossrs/srs-stack:$SRS_MAJOR_HTTPS \ | |
-f scripts/nginx-hls-cdn/Dockerfile.https \ | |
scripts/nginx-hls-cdn | |
- name: Alias HTTPS docker image | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/srs-stack:${{ env.SRS_MAJOR_HTTPS }} | |
dst: | | |
ossrs/srs-stack:${{ env.SRS_MAJOR_HTTPS }}-${{ env.SRS_VERSION }} | |
runs-on: ubuntu-20.04 | |
aliyun: | |
needs: | |
- envs | |
- docker | |
steps: | |
- name: Covert output to env | |
run: | | |
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV | |
echo "SRS_MAJOR_HTTP=${{ needs.envs.outputs.SRS_MAJOR_HTTP }}" >> $GITHUB_ENV | |
echo "SRS_MAJOR_HTTPS=${{ needs.envs.outputs.SRS_MAJOR_HTTPS }}" >> $GITHUB_ENV | |
- 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: Alias HTTP docker images | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/srs-stack:${{ env.SRS_MAJOR_HTTP }} | |
dst: | | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:${{ env.SRS_MAJOR_HTTP }} | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:${{ env.SRS_MAJOR_HTTP }}-${{ env.SRS_VERSION }} | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:nginx-hls-cdn-${{ env.SRS_VERSION }} | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:nginx-hls-cdn | |
- name: Alias HTTPS docker images | |
uses: akhilerm/[email protected] | |
with: | |
src: ossrs/srs-stack:${{ env.SRS_MAJOR_HTTPS }} | |
dst: | | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:${{ env.SRS_MAJOR_HTTPS }} | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:${{ env.SRS_MAJOR_HTTPS }}-${{ env.SRS_VERSION }} | |
runs-on: ubuntu-20.04 |