Update README.md #19
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [21.1.0] | |
pnpm-version: [8.14.1] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build Vite app | |
run: pnpm live | |
- name: Prepare dist for deployment | |
run: | | |
shopt -s extglob | |
rm -rf !(dist) | |
mv dist/* . | |
rm -r dist | |
- name: Commit and push to deploy branch | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git checkout -b deploy | |
git add -A | |
git commit -m "Deploy app" | |
git push -f origin deploy |