forked from marciogranzotto/addon-nightscout
-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (52 loc) · 2.08 KB
/
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
name: Docker build and publish
on:
release:
types: [published]
jobs:
build-amd64:
name: Build and publish amd64 image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
- name: Patch files
uses: onlyutkarsh/[email protected]
with:
files: |
nightscout/config.json
patch-syntax: |
= /version => "${{ env.VERSION }}"
- name: publish amd64 docker files
if: github.event_name != 'pull_request'
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t nightscout --amd64 --release-tag --docker-user ihlcz --docker-password ${{ secrets.DOCKER_PASSWORD }}
build-aarch64:
name: Build and publish aarch64 image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
- name: Patch files
uses: onlyutkarsh/[email protected]
with:
files: |
nightscout/config.json
patch-syntax: |
= /version => "${{ env.VERSION }}"
- name: publish aarch64 docker files
if: github.event_name != 'pull_request'
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t nightscout --aarch64 --release-tag --docker-user ihlcz --docker-password ${{ secrets.DOCKER_PASSWORD }}
update-main-repo:
needs: [build-amd64, build-aarch64]
name: Update addons repository
runs-on: ubuntu-latest
container:
image: hassioaddons/repository-updater:latest
steps:
- name: upload
run: repository-updater --token ${{ secrets.GIT_TOKEN }} --repository i-cz/addons-repository --addon nightscout