Remote Dispatch Preview Build #30
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: Remote Dispatch Preview Build | |
# Manually send a dispatch to build standard preview (master) or dev preview (other refs) | |
on: | |
# Dispatch or Manual triggers | |
workflow_dispatch: | |
# push: | |
# branches: | |
# - master | |
# # - develop | |
# paths: | |
# - '**' | |
# - '!**.md' | |
# - '!.github/**' | |
# - '.github/scripts/**' | |
# - '.github/workflows/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
trigger_preview_build: | |
name: Trigger preview build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Validate Gradle Wrapper | |
uses: gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4 | |
- name: Prepare build | |
id: prepare_build | |
run: | | |
set -e | |
commit_count=$(git rev-list --count HEAD) | |
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT | |
- name: Create Tag 'r${{ steps.prepare_build.outputs.COMMIT_COUNT }}' | |
if: ${{ github.ref }} == "refs/heads/master" | |
run: | | |
git tag "r${{ steps.prepare_build.outputs.COMMIT_COUNT }}" | |
git push origin "r${{ steps.prepare_build.outputs.COMMIT_COUNT }}" | |
- name: Get branch names | |
id: branch_names | |
uses: tj-actions/branch-names@6871f53176ad61624f978536bbf089c574dc19a2 # v8.0.1 | |
- name: Invoke workflow in preview repo | |
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
with: | |
workflow: build_app.yml | |
repo: komikku-app/komikku-preview | |
ref: "refs/heads/main" | |
token: "${{ secrets.BOT_PAT }}" | |
inputs: '{ "git-ref": "${{ steps.branch_names.outputs.current_branch }}" }' |