Deploy to GHCR #627
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GHCR | |
on: | |
# Build and deploy the image on pushes to main branch | |
workflow_dispatch: | |
inputs: | |
reason: | |
required: true | |
description: "Reason for running this workflow" | |
use_test_image: | |
required: false | |
type: boolean | |
description: "Use base image testpr" | |
default: false | |
# Build and deploy the image on pushes to master branch | |
push: | |
branches: | |
- main | |
paths: | |
- "rust/**" | |
- "Dockerfile**" | |
- "rootfs/**" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: webproxy | |
REPO: sdr-enthusiasts | |
IMAGE: docker-reversewebproxy | |
jobs: | |
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 }} | |
INPUTS_USE_TEST_IMAGE: ${{ github.event.inputs.use_test_image }} | |
run: | | |
echo "Workflow dispatch reason: $INPUTS_REASON" | |
echo "Use test image: $INPUTS_USE_TEST_IMAGE" | |
build_and_push: | |
name: Image Build & Push | |
uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main | |
with: | |
push_enabled: true | |
push_destinations: ghcr.io;dockerhub | |
dockerhub_profile: kx1t #legacy | |
dockerhub_repo: webproxy #legacy | |
ghcr_repo_owner: ${{ github.repository_owner }} | |
ghcr_repo: sdr-enthusiasts/webproxy | |
platform_linux_arm32v6_enabled: false | |
platform_linux_i386_enabled: false | |
# set build_latest to true if github.event.inputs.use_test_image is false | |
build_latest: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }} | |
build_baseimage_test: ${{ github.event.inputs.use_test_image == 'true' || github.event.inputs.use_test_image == '' }} | |
# only build the entire stack if we are not using the test image | |
build_version_specific: false | |
build_platform_specific: false | |
build_nohealthcheck: false | |
build_baseimage_url: :python/:python-test-pr | |
secrets: | |
ghcr_token: ${{ secrets.GITHUB_TOKEN }} | |
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} | |
build_and_push_too: | |
name: Image Build & Push - secondary container target | |
uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main | |
with: | |
push_enabled: true | |
push_destinations: ghcr.io | |
ghcr_repo_owner: ${{ github.repository_owner }} | |
ghcr_repo: sdr-enthusiasts/docker-reversewebproxy | |
platform_linux_arm32v6_enabled: false | |
platform_linux_i386_enabled: false | |
# set build_latest to true if github.event.inputs.use_test_image is false | |
build_latest: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }} | |
build_baseimage_test: ${{ github.event.inputs.use_test_image == 'true' || github.event.inputs.use_test_image == '' }} | |
# only build the entire stack if we are not using the test image | |
build_version_specific: false | |
build_platform_specific: false | |
build_nohealthcheck: false | |
build_baseimage_url: :python/:python-test-pr | |
secrets: | |
ghcr_token: ${{ secrets.GITHUB_TOKEN }} | |
# dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} |