-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (56 loc) · 1.65 KB
/
Copy pathdocker-image.yml
File metadata and controls
68 lines (56 loc) · 1.65 KB
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
name: Docker Image CI
on:
push:
#tags:
#- '*'
# To have GitHub Actions deploy a new version, create a new tag
# git tag -a yyyy.m.d -m yyyy.m.d
# Then push those tags
# git push --tags
# Then a new version will be deployed on the self-hosted runner.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build ARM64 image
uses: docker/build-push-action@v5
with:
context: .
file: ./HomeSpeaker.Server2/Dockerfile
platforms: linux/arm64
tags: homespeakerserver2:latest
outputs: type=docker,dest=/tmp/homespeaker-arm64.tar
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: homespeaker-arm64-image
path: /tmp/homespeaker-arm64.tar
retention-days: 1
deploy:
needs: build
runs-on: [self-hosted, "${{ matrix.runner}}" ]
strategy:
matrix:
runner: [rpi4, rpi42]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download image artifact
uses: actions/download-artifact@v4
with:
name: homespeaker-arm64-image
path: /tmp/
- name: Load Docker image
run: docker load < /tmp/homespeaker-arm64.tar
- name: Docker compose down
run: docker-compose down
- name: Docker compose up
env:
GOVEE_API_KEY: ${{ secrets.GOVEE_API_KEY }}
run: docker-compose up -d --remove-orphans