dispatch_publish #57
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: Publish PDF release to website | |
on: | |
workflow_dispatch: | |
inputs: | |
release_type: | |
description: Release type | |
type: choice | |
required: true | |
options: | |
- latest | |
- stable | |
- prerelease | |
default: latest | |
repository_dispatch: | |
types: [dispatch_publish] | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
deploy_web: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set release type based on originating event | |
id: get_release_type | |
run: | | |
if [[ "${{github.event_name}}" == "workflow_dispatch" ]]; | |
then computed_release_type="${{inputs.release_type}}"; | |
else computed_release_type="latest"; | |
fi | |
echo "::debug::RELEASE_TYPE=$computed_release_type" | |
echo "RELEASE_TYPE=$computed_release_type" >> $GITHUB_OUTPUT | |
- name: Get the release | |
uses: rez0n/actions-github-release@v2.0 | |
id: cv_release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: "maxpowis/cv" | |
type: ${{ steps.get_release_type.outputs.RELEASE_TYPE }} | |
- name: Echo release tag name | |
run: echo "::debug::Found tag for ${{ steps.get_release_type.outputs.RELEASE_TYPE }} release >> ${{ steps.cv_release.outputs.release }}" | |
- name: Download all pdf's from release | |
uses: robinraju/release-downloader@v1.8 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: "maxpowis/cv" | |
tag: ${{ steps.cv_release.outputs.release }} | |
fileName: '*.pdf' | |
- name: Publish all pdf's to website | |
uses: dmnemec/copy_file_to_another_repo_action@v1.1.1 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_TOKEN_REPO_WORKFLOW }} | |
with: | |
source_file: '*.pdf' | |
destination_repo: 'maxpowis/maxpowis.github.io' | |
destination_branch: 'master' | |
destination_folder: 'assets' | |
user_email: 'max.powis@gmail.com' | |
user_name: 'maxpowis' |