Skip to content

Commit

Permalink
Probably creates github action to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkar598 authored Jun 23, 2023
1 parent 6503680 commit 0b331e4
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
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

0 comments on commit 0b331e4

Please sign in to comment.