trying to fix workflow #3
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: | ||
- code | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- name: Install gatsby-clit | ||
run: npm install -g gatsby-cli | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build the project | ||
run: npm run build | ||
- name: Deploy to GitHub Pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add -f public | ||
git commit -m 'Deploy build' | ||
git subtree split --prefix public -b gh-pages | ||
git push origin gh-pages:master --force |