-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (68 loc) · 2.63 KB
/
server-publish.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
name: Publish Server Images
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
env:
IMAGE_NAME: server-rpi
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platforms::linux/arm/v6
echo ::set-output name=docker_username::drakeapps
echo ::set-output name=version::${GITHUB_REF#refs/*/}
echo ::set-output name=hash::${GITHUB_SHA}
- name: Set up buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: GHCR Login
if: success()
env:
CR_PAT: ${{ secrets.CR_PAT }}
run: |
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build rpi image
if: success() && contains(steps.prepare.outputs.version, 'master')
run: |
make rpi
docker buildx build \
--output type=image,name=ghcr.io/drakeapps/cloud-led-controller/server-rpi,push=true \
--platform linux/arm/v6 \
--tag "ghcr.io/drakeapps/cloud-led-controller/server-rpi:latest" \
--file Dockerfile .
- name: Build rpi2 image
if: success() && contains(steps.prepare.outputs.version, 'master')
run: |
make rpi2
docker buildx build \
--output type=image,name=ghcr.io/drakeapps/cloud-led-controller/server-rpi2,push=true \
--platform linux/arm/v7 \
--tag "ghcr.io/drakeapps/cloud-led-controller/server-rpi2:latest" \
--file Dockerfile .
- name: Build rpi3 image
if: success() && contains(steps.prepare.outputs.version, 'master')
run: |
make rpi3
docker buildx build \
--output type=image,name=ghcr.io/drakeapps/cloud-led-controller/server-rpi3,push=true \
--platform linux/arm/v7 \
--tag "ghcr.io/drakeapps/cloud-led-controller/server-rpi3:latest" \
--file Dockerfile .
- name: Build rpi4-64 image
if: success() && contains(steps.prepare.outputs.version, 'master')
run: |
make rpi4-64
docker buildx build \
--output type=image,name=ghcr.io/drakeapps/cloud-led-controller/server-rpi3,push=true \
--platform linux/arm64 \
--tag "ghcr.io/drakeapps/cloud-led-controller/server-rpi4-64:latest" \
--file Dockerfile .