Files
Shortumation/.github/workflows/deploy.yml
T
2022-05-18 22:42:56 -04:00

75 lines
2.1 KiB
YAML

name: Deploy
env:
MONITORED_FILES: "apparmor.txt build.yaml config.yaml Dockerfile data rootfs"
on:
workflow_dispatch:
push:
branch: [main]
paths:
- "config.yaml"
jobs:
metadata:
runs-on: ubuntu-latest
name: Metadata
outputs:
version: ${{ steps.version.outputs.VERSION }}
changlelog: ${{ steps.changlelog.outputs.CHANGELOG }}
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: Get Changelog
id: changlelog
shell: bash
run: |
echo ::set-output name=CHANGELOG::$(cat CHANGELOG.md)
# build:
# runs-on: ubuntu-latest
# name: Build & Publish ${{ matrix.arch }}
# needs:
# - metadata
# strategy:
# matrix:
# arch: ["aarch64", "amd64", "armhf", "armv7", "i386"]
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# - name: Login to DockerHub
# uses: docker/login-action@v2.0.0
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build & Push to Dockerhub - ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }}
# uses: home-assistant/builder@2022.03.1
# with:
# args: |
# --${{ matrix.arch }} \
# --target .
publish:
runs-on: ubuntu-latest
needs:
- metadata
name: Publish Github Release
steps:
- name: Publish Release ${{ needs.metadata.outputs.version }}
uses: actions/github-script@v6
env:
VERSION: ${{ needs.metadata.outputs.version }}
CHANGELOG: ${{ needs.metadata.outputs.changlelog }}
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.VERSION,
});