Skip to content

Commit

Permalink
Update 02-deploy-gh-pages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranzke authored Oct 23, 2024
1 parent b81f80a commit 535d15e
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions .github/workflows/02-deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ name: Deploy to gh-pages

on:
workflow_call:
inputs:
release:
required: false
default: "false"
type: string
preRelease:
required: false
default: "false"
type: string

jobs:
deploy:
Expand All @@ -22,8 +31,38 @@ jobs:
name: build
path: out

- name: ➕ Bundle current gh-pages
uses: ./.github/actions/bundle-gh-page
- name: ↔ Extract branch/tag name
shell: bash
env:
RELEASE: ${{ inputs.release }}
PRE_RELEASE: ${{ inputs.preRelease }}
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch-name }}
run: |
if [[ $RELEASE == "true" || $PRE_RELEASE == "true" ]]
then
echo "name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
fi
id: extract

- name: 📛 Get repo name
uses: actions/github-script@v7
id: repo-name
with:
result-encoding: string
script: return context?.payload?.repository?.name

- name: 🔨 Build page
env:
RELEASE: ${{ inputs.release }}
PRE_RELEASE: ${{ inputs.preRelease }}
NAME: ${{ steps.extract.outputs.name }}
REPO_NAME: ${{ steps.repo-name.outputs.result }}
OWNER_NAME: ${{ github.repository_owner }}
run: |
chmod +rx ./.github/scripts/build-gh-page.sh
./.github/scripts/build-gh-page.sh
- name: 🥅 Deploy to GH-Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down

0 comments on commit 535d15e

Please sign in to comment.