forked from Akasiek/Random-Plex-Movie
-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (68 loc) · 1.99 KB
/
docker-build.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
name: Docker Build
on:
push:
branches: [ main ]
paths:
- 'Dockerfile'
- 'Dockerfile.arm'
- 'requirements.txt'
- 'movie_selector.py'
- '.github/workflows/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,arm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Login to both registries
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: sahara101
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build AMD64 image
- name: Build and push AMD64
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: |
sahara101/movie-roulette:latest
sahara101/movie-roulette:v3.1
ghcr.io/sahara101/movie-roulette:latest
ghcr.io/sahara101/movie-roulette:v3.1
# Build ARM image
- name: Build and push ARM
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.arm
platforms: linux/arm64,linux/arm/v7
push: true
tags: |
sahara101/movie-roulette:arm-latest
sahara101/movie-roulette:arm-v3.1
ghcr.io/sahara101/movie-roulette:arm-latest
ghcr.io/sahara101/movie-roulette:arm-v3.1