Skip to content

Commit

Permalink
Fix deploy version
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogranzotto committed Aug 13, 2020
1 parent 9a994d1 commit 222c7a3
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/publish.yml
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
Expand All @@ -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

0 comments on commit 222c7a3

Please sign in to comment.