Fix contacts persist on refresh #8
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 to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Save build output | |
run: | | |
mkdir -p ~/build-output | |
cp -r out/. ~/build-output/ | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
clean: true | |
- name: Clear gh-pages branch | |
run: | | |
find . -maxdepth 1 ! -name '.git' ! -name '.' -exec rm -rf {} + | |
mkdir docs | |
- name: Restore build output | |
run: cp -r ~/build-output/. docs/ | |
- name: Add nojekyll file | |
run: touch docs/.nojekyll | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Commit and push changes | |
run: | | |
git add -A | |
git commit -m "Deploy to GitHub Pages" | |
git push origin gh-pages |