49 lines
1.3 KiB
YAML
49 lines
1.3 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)
|
|
|
|
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,
|
|
});
|