-
-
Notifications
You must be signed in to change notification settings - Fork 117
108 lines (104 loc) · 4.16 KB
/
nginx-hls-cdn.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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/oryx:$SRS_MAJOR_HTTP-$SRS_VERSION"
docker buildx build --platform linux/amd64,linux/arm64/v8 \
--output "type=image,push=true" \
--tag ossrs/oryx:$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/oryx:${{ env.SRS_MAJOR_HTTP }}
dst: |
ossrs/oryx:${{ env.SRS_MAJOR_HTTP }}-${{ env.SRS_VERSION }}
ossrs/oryx:nginx-hls-cdn-${{ env.SRS_VERSION }}
ossrs/oryx:nginx-hls-cdn
- name: Build HTTPS docker image
run: |
echo "Release ossrs/oryx:$SRS_MAJOR_HTTPS-$SRS_VERSION"
docker buildx build --platform linux/amd64,linux/arm64/v8 \
--output "type=image,push=true" \
--tag ossrs/oryx:$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/oryx:${{ env.SRS_MAJOR_HTTPS }}
dst: |
ossrs/oryx:${{ 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/oryx:${{ env.SRS_MAJOR_HTTP }}
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/oryx:${{ env.SRS_MAJOR_HTTP }}
registry.cn-hangzhou.aliyuncs.com/ossrs/oryx:${{ env.SRS_MAJOR_HTTP }}-${{ env.SRS_VERSION }}
registry.cn-hangzhou.aliyuncs.com/ossrs/oryx:nginx-hls-cdn-${{ env.SRS_VERSION }}
registry.cn-hangzhou.aliyuncs.com/ossrs/oryx:nginx-hls-cdn
- name: Alias HTTPS docker images
uses: akhilerm/[email protected]
with:
src: ossrs/oryx:${{ env.SRS_MAJOR_HTTPS }}
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/oryx:${{ env.SRS_MAJOR_HTTPS }}
registry.cn-hangzhou.aliyuncs.com/ossrs/oryx:${{ env.SRS_MAJOR_HTTPS }}-${{ env.SRS_VERSION }}
runs-on: ubuntu-20.04