Skip to content

Commit

Permalink
I hate github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkar598 committed Jun 23, 2023
1 parent 951cd54 commit eaae35e
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 49 deletions.
98 changes: 50 additions & 48 deletions .github/workflows/deploy.yml
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
*.tsbuildinfo
*.tsbuildinfo
rootfs.iso9660

0 comments on commit eaae35e

Please sign in to comment.