From 535d15e70cd4a76d133eccb282650c36c83ef08f Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Wed, 23 Oct 2024 08:42:01 +0200 Subject: [PATCH] Update 02-deploy-gh-pages.yml --- .github/workflows/02-deploy-gh-pages.yml | 43 ++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/02-deploy-gh-pages.yml b/.github/workflows/02-deploy-gh-pages.yml index 7c53e66..6110c1c 100644 --- a/.github/workflows/02-deploy-gh-pages.yml +++ b/.github/workflows/02-deploy-gh-pages.yml @@ -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: @@ -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