Skip to content

Docker build and publish #5

Docker build and publish

Docker build and publish #5

Workflow file for this run

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