forked from corbinbs/solarshed
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (39 loc) · 1.08 KB
/
ci.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
name: ci
on:
push:
branches: master
jobs:
docker-build-push:
runs-on: build
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build
run: docker build -t ghcr.io/truncj/solarshed .
-
name: Tag
run: |
docker tag ghcr.io/truncj/solarshed ghcr.io/truncj/solarshed:latest
docker tag ghcr.io/truncj/solarshed ghcr.io/truncj/solarshed:${{ github.sha }}
-
name: Push
run: |
docker push ghcr.io/truncj/solarshed:${{ github.sha }}
docker push ghcr.io/truncj/solarshed:latest
docker-deploy:
runs-on: deploy
steps:
-
name: Deploy
run: |
docker rm -f solarshed
docker run --name solarshed -d -p 5000:5000 --device /dev/ttyUSB0:/dev/ttyUSB0 --restart=always ghcr.io/truncj/solarshed