Bump the all-dependencies group with 3 updates (#1824) #745
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: Pages | |
on: | |
push: | |
branches: | |
- 'main' | |
permissions: | |
contents: write | |
jobs: | |
pages: | |
name: Pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: check out | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: setup node | |
uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'npm' | |
# https://github.com/Automattic/node-canvas/wiki/Installation:-Arch-based-distributions | |
- run: | | |
sudo apt-get update | |
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev | |
- run: npm ci | |
- run: npm run build | |
- run: | | |
git fetch --depth=1 origin pages || true | |
- name: create pages content | |
run: | | |
# Git config | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
# Move contents to temp files | |
cp -r packages/pages/dist/ $GITHUB_WORKSPACE/pages/ | |
# Checkout pages branches | |
git checkout pages 2>/dev/null || git checkout -b pages | |
git reset --hard origin/pages | |
# Clean pages branch | |
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + | |
git ls-files -z | xargs -0 rm -f || true | |
git ls-tree --name-only -d -r -z HEAD | sort -rz | xargs -0 rmdir || true | |
rm -rf ./packages | |
# Copy contents | |
cp -r $GITHUB_WORKSPACE/pages/ ./docs/ | |
rm -rf $GITHUB_WORKSPACE/pages/ | |
# Submit | |
git add . | |
git commit -m "update pages" | |
git push --set-upstream origin pages | |
deploy-pages-worker: | |
name: Deploy Pages Worker | |
runs-on: ubuntu-latest | |
steps: | |
- name: check out | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: publish | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
wranglerVersion: '1.13.0' | |
workingDirectory: 'packages/pages-worker' | |
command: publish |