51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: Deploy
|
|
env:
|
|
MONITORED_FILES: "apparmor.txt build.yaml config.yaml Dockerfile data rootfs"
|
|
on:
|
|
# release:
|
|
# types: [published]
|
|
push:
|
|
paths:
|
|
- 'config.yaml'
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: ${{ matrix.arch }}
|
|
strategy:
|
|
matrix:
|
|
arch: ["aarch64", "amd64", "armhf", "armv7", "i386"]
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get Version
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
echo ::set-output name=VERSION::$(cat config.yaml | sed -nr 's/version: (.*)/\1/p')
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v2.0.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: ${{ steps.version.outputs.VERSION }} / ${{ matrix.arch }}
|
|
uses: home-assistant/builder@2022.03.1
|
|
with:
|
|
args: |
|
|
--${{ matrix.arch }} \
|
|
--target .
|
|
|
|
- name: Publish Release ${{ steps.version.outputs.VERSION }}
|
|
uses: actions/github-script@v6
|
|
env:
|
|
VERSION: ${{ steps.version.outputs.VERSION }}
|
|
with:
|
|
script: |
|
|
github.rest.repos.createRelease({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
tag_name: process.env.VERSION,
|
|
}); |