-
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.
Probably creates github action to deploy
- Loading branch information
1 parent
6503680
commit 0b331e4
Showing
1 changed file
with
48 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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 | ||
|
||
- 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 |