Skip to content

Commit

Permalink
ci: Switch to GH Actions pages (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt authored Dec 15, 2023
1 parent db57e6f commit b104de6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 161 deletions.
50 changes: 33 additions & 17 deletions .github/workflows/deploy-editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,47 @@ name: Deploy Editor

on:
push:
branches:
- main
branches: [main]
workflow_dispatch:

jobs:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false

deploy:
jobs:
Build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
- run: pnpm install
- run: pnpm build-editor
- run: |
pnpm install
pnpm build-editor
echo "gosling.js.org" >> build/CNAME
env:
NODE_OPTIONS: '--max_old_space_size=8192'
- name: Deploy editor
run: |
git config --global user.name "[email protected]"
git config --global user.email "GitHub Action"
git remote set-url origin https://${ACCESS_TOKEN}@github.com/${REPO}.git
pnpm run predeploy
pnpm run deploy
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REPO: ${{ github.repository }}
- uses: actions/upload-pages-artifact@v2
with:
path: build

Deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: Build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"coverage": "vitest run --coverage",
"format": "eslint src/ editor/ --fix && prettier 'editor/**/*.css' --write",
"schema": "node scripts/generate-schemas.mjs",
"predeploy": "pnpm build-editor; echo \"gosling.js.org\" >> build/CNAME",
"deploy": "gh-pages -d build",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
"knip": "knip --config knip.config.json",
"e2e": "playwright test",
Expand Down Expand Up @@ -126,7 +124,6 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"fetch-jsonp": "^1.1.3",
"gh-pages": "^3.1.0",
"jsdom": "^19.0.0",
"jsoncrush": "^1.1.6",
"knip": "^2.30.0",
Expand Down
146 changes: 5 additions & 141 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b104de6

Please sign in to comment.