-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a994d1
commit 222c7a3
Showing
1 changed file
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,92 @@ | ||
name: Docker build and publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
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 ::set-env name=VERSION::${TAG_NAME#v} | ||
- name: Patch files | ||
uses: onlyutkarsh/[email protected] | ||
with: | ||
files: | | ||
nightscout/config.json | ||
patch-syntax: | | ||
= /version => "${{ github.event.release.tag_name }}" | ||
= /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 marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
build-armv7: | ||
name: Build and publish armv7 image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get version | ||
env: | ||
TAG_NAME: ${{ github.event.release.tag_name }} | ||
run: echo ::set-env name=VERSION::${TAG_NAME#v} | ||
- name: Patch files | ||
uses: onlyutkarsh/[email protected] | ||
with: | ||
files: | | ||
nightscout/config.json | ||
patch-syntax: | | ||
= /version => "${{ github.event.release.tag_name }}" | ||
= /version => "${{ env.VERSION }}" | ||
- name: publish armv7 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 --armv7 --release-tag --docker-user marciogranzotto --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 ::set-env name=VERSION::${TAG_NAME#v} | ||
- name: Patch files | ||
uses: onlyutkarsh/[email protected] | ||
with: | ||
files: | | ||
nightscout/config.json | ||
patch-syntax: | | ||
= /version => "${{ github.event.release.tag_name }}" | ||
= /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 marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
build-i386: | ||
name: Build and publish i386 image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get version | ||
env: | ||
TAG_NAME: ${{ github.event.release.tag_name }} | ||
run: echo ::set-env name=VERSION::${TAG_NAME#v} | ||
- name: Patch files | ||
uses: onlyutkarsh/[email protected] | ||
with: | ||
files: | | ||
nightscout/config.json | ||
patch-syntax: | | ||
= /version => "${{ github.event.release.tag_name }}" | ||
= /version => "${{ env.VERSION }}" | ||
- name: publish i386 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 --i386 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
update-main-repo: | ||
needs: [build-amd64, build-armv7, build-aarch64, build-i386] | ||
name: Update addons repository | ||
|
@@ -75,4 +95,4 @@ jobs: | |
image: hassioaddons/repository-updater:latest | ||
steps: | ||
- name: upload | ||
run: repository-updater --token ${{ secrets.GIT_TOKEN }} --repository marciogranzotto/addons-repository --addon nightscout | ||
run: repository-updater --token ${{ secrets.GIT_TOKEN }} --repository marciogranzotto/addons-repository --addon nightscout |