Skip to content

Commit 3286a80

Browse files
authored
✨ Add support for multiarch builds, including ARM (e.g. Mac M1) (#65)
1 parent 3830097 commit 3286a80

File tree

5 files changed

+29
-40
lines changed

5 files changed

+29
-40
lines changed

.github/workflows/deploy.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,30 @@ on:
99
- cron: "0 0 * * 1"
1010

1111
jobs:
12-
build:
12+
deploy:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Deploy Image
17-
run: bash scripts/build-push.sh
18-
env:
19-
NAME: latest
20-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
21-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v1
18+
- name: Login to DockerHub
19+
uses: docker/login-action@v1
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Get date for tags
24+
run: echo "DATE_TAG=$(date -I)" >> "$GITHUB_ENV"
25+
- name: Build and push
26+
uses: docker/build-push-action@v2
27+
with:
28+
push: true
29+
platforms: linux/amd64,linux/arm64
30+
tags: |
31+
tiangolo/nginx-rtmp:${{ matrix.image.name }}
32+
tiangolo/nginx-rtmp:${{ matrix.image.name }}-${{ env.DATE_TAG }}
2233
- name: Docker Hub Description
2334
uses: peter-evans/dockerhub-description@v4
2435
with:
25-
username: ${{ secrets.DOCKER_USERNAME }}
26-
password: ${{ secrets.DOCKER_PASSWORD }}
36+
username: ${{ secrets.DOCKERHUB_USERNAME }}
37+
password: ${{ secrets.DOCKERHUB_TOKEN }}
2738
repository: tiangolo/nginx-rtmp

.github/workflows/test.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ on:
1313
- cron: "0 0 * * 1"
1414

1515
jobs:
16-
build:
16+
test:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
2022
- name: Build Image
21-
run: bash scripts/build.sh
22-
env:
23-
NAME: latest
23+
uses: docker/build-push-action@v2
24+
with:
25+
push: false
26+
tags: tiangolo/nginx-rtmp:latest
27+
platforms: linux/amd64,linux/arm64
2428
check:
2529
if: always()
2630
needs:
27-
- build
31+
- test
2832
runs-on: ubuntu-latest
2933
steps:
3034
- name: Decide whether the needed jobs succeeded or failed

scripts/build-push.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

scripts/build.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

scripts/docker-login.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)