-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
951cd54
commit eaae35e
Showing
2 changed files
with
52 additions
and
49 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 |
---|---|---|
@@ -1,53 +1,55 @@ | ||
name: Deploy code | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Upgrade NPM | ||
run: npm install -g npm | ||
|
||
- name: Install NPM Dependencies | ||
run: npm ci | ||
|
||
- name: Create iso placeholder | ||
run: touch rootfs.iso9660 | ||
|
||
- name: Compile | ||
run: npx vite build --base=/dm-playground | ||
env: | ||
VITE_ISO_URL: https://spacestation13.github.io/dm-playground-linux/rootfs.iso9660 | ||
|
||
- name: Create workdir | ||
run: | | ||
git fetch origin dist | ||
git worktree add --detach $HOME/distbranch | ||
cd $HOME/distbranch | ||
git switch --orphan tmp-deploy | ||
touch .nojekyll | ||
- name: Copy files | ||
run: | | ||
cp $GITHUB_WORKSPACE/dist/* . -R | ||
- name: Deploy to Github | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add . | ||
git commit -m "Update dist" | ||
git push origin HEAD:dist --force | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Upgrade NPM | ||
run: npm install -g npm | ||
|
||
- name: Install NPM Dependencies | ||
run: npm ci | ||
|
||
- name: Create iso placeholder | ||
run: touch rootfs.iso9660 | ||
|
||
- name: Compile | ||
run: npx vite build --base=/dm-playground | ||
env: | ||
VITE_ISO_URL: https://spacestation13.github.io/dm-playground-linux/rootfs.iso9660 | ||
|
||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: dist | ||
|
||
deploy: | ||
needs: build | ||
|
||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
node_modules/ | ||
*.tsbuildinfo | ||
*.tsbuildinfo | ||
rootfs.iso9660 |