54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
name: publish tagged release docker
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository_owner == 'TandoorRecipes'
|
|
runs-on: ubuntu-latest
|
|
name: Build image job
|
|
steps:
|
|
- name: Checkout master
|
|
uses: actions/checkout@master
|
|
- name: Get version number
|
|
id: get_version
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
|
# Update Version number
|
|
- name: Update version file
|
|
uses: DamianReeves/write-file-action@v1.0
|
|
with:
|
|
path: recipes/version.py
|
|
contents: |
|
|
VERSION_NUMBER = '${{ steps.get_version.outputs.VERSION }}'
|
|
BUILD_REF = '${{ github.sha }}'
|
|
write-mode: overwrite
|
|
# Build Vue frontend
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '14'
|
|
- name: Install dependencies
|
|
working-directory: ./vue
|
|
run: yarn install
|
|
- name: Build dependencies
|
|
working-directory: ./vue
|
|
run: yarn build
|
|
# Build container
|
|
- name: Build and publish image
|
|
uses: ilteoood/docker_buildx@master
|
|
with:
|
|
publish: true
|
|
imageName: vabene1111/recipes
|
|
platform: linux/amd64,linux/arm64
|
|
tag: ${{ steps.get_version.outputs.VERSION }}
|
|
dockerUser: ${{ secrets.DOCKER_USERNAME }}
|
|
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}
|
|
# Send discord notification
|
|
- name: Discord notification
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@0.3.2
|
|
with:
|
|
args: '🚀 Version {{ EVENT_PAYLOAD.release.tag_name }} of tandoor has been released 🥳 Check it out https://github.com/vabene1111/recipes/releases/tag/{{ EVENT_PAYLOAD.release.tag_name }}'
|