-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Switch to GH Actions pages (#1015)
- Loading branch information
Showing
3 changed files
with
38 additions
and
161 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.