2023-03-21 19:56:02 +00:00
|
|
|
---
|
2023-03-22 16:23:54 +00:00
|
|
|
name: Deploy
|
2023-03-21 19:56:02 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
reason:
|
2023-03-22 16:23:54 +00:00
|
|
|
required: true
|
2023-03-21 19:56:02 +00:00
|
|
|
description: 'Reason for running this workflow'
|
2023-03-22 16:23:54 +00:00
|
|
|
|
2023-03-21 19:56:02 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-03-22 16:23:54 +00:00
|
|
|
# Trigger only on specific files being updated.
|
2023-03-21 19:56:02 +00:00
|
|
|
|
2023-03-22 16:23:54 +00:00
|
|
|
paths:
|
|
|
|
- Dockerfile
|
|
|
|
- rootfs/**
|
2023-03-21 19:56:02 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-03-22 16:23:54 +00:00
|
|
|
|
2023-03-21 19:56:02 +00:00
|
|
|
workflow-dispatch:
|
|
|
|
name: Triggered via Workflow Dispatch?
|
|
|
|
# only run this step if workflow dispatch triggered
|
|
|
|
# log the reason the workflow dispatch was triggered
|
|
|
|
if: |
|
|
|
|
github.event_name == 'workflow_dispatch' &&
|
|
|
|
github.event.inputs.reason != ''
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Log dispatch reason
|
|
|
|
env:
|
|
|
|
INPUTS_REASON: ${{ github.event.inputs.reason }}
|
|
|
|
run: |
|
|
|
|
echo "Workflow dispatch reason: $INPUTS_REASON"
|
|
|
|
|
2023-03-22 16:23:54 +00:00
|
|
|
deploy:
|
|
|
|
name: Deploy
|
|
|
|
uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main
|
|
|
|
with:
|
|
|
|
push_enabled: true
|
|
|
|
push_destinations: ghcr.io;dockerhub
|
|
|
|
ghcr_repo_owner: ${{ github.repository_owner }}
|
|
|
|
ghcr_repo: ${{ github.repository }}
|
|
|
|
dockerhub_profile: mikenye
|
|
|
|
dockerhub_repo: tar1090
|
|
|
|
get_version_method: git_commit_hash_short
|
|
|
|
secrets:
|
|
|
|
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
|