Update deploy.yml #6
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: Deploy code | |
on: | |
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: 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 $HOME/distbranch origin/dist | |
touch $HOME/distbranch/.nojekyll | |
- name: Copy files | |
run: | | |
cp ./dist/* $HOME/distbranch -R | |
- name: Deploy to Github | |
run: | | |
cd $HOME/distbranch | |
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 pull --rebase origin dist | |
git push origin HEAD:dist |