Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 11 additions & 56 deletions .github/workflows/deploy-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:
VALIDATOR_OAUTH_CLIENT_ID: ${{ secrets.VALIDATOR_OAUTH_CLIENT_ID }}
VALIDATOR_OAUTH_CLIENT_SECRET: ${{ secrets.VALIDATOR_OAUTH_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
# fetch complete history for step "export drawios" to safely determine
# date of last update to drawio files via git log
fetch-depth: 0

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: npm
Expand Down Expand Up @@ -76,66 +78,19 @@ jobs:
run: node src/_scripts/_update-drawio-links.js

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: build

deploy:
name: Deploy Site
runs-on: ubuntu-latest
needs: build
environment: github-pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: success()
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAASAPCOM_PAT }}

- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
path: __build__

- name: Set up Git
run: |
git config --global user.email "paa@sap.com"
git config --global user.name "paasapcom"

- name: Switch to Pages Branch
run: |
gh_pages_branch=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.source.branch')
git fetch origin $gh_pages_branch
git checkout $gh_pages_branch
echo "gh_pages_branch=$gh_pages_branch" >> "$GITHUB_ENV"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Drop Previous Content
run: |
shopt -s extglob
rm -rf !(@*|__build__)

- name: Extract Build Content
run: |
if [[ -d "__build__" && "$(ls -A __build__)" ]]; then
mv __build__/* ./
tar -xvf github-pages/artifact.tar
rm github-pages/artifact.tar
rm -rf __build__
else
echo "No build files found. Skipping move step."
fi

- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.PAASAPCOM_PAT }}
# prevent history build-up and .git bloat with orphan
run: |
git checkout --orphan site-anew
git add -A
if [[ "$(git status -s)" ]]; then
git commit -m "site build ➝ gh pages"
git push -f origin HEAD:${{ env.gh_pages_branch }}
fi
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
Loading