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 # Change this to your main branch name | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies and build | |
run: | | |
npm install | |
cd server && npm run build | |
# Find the dist directory and set it as an output variable | |
find . -type d -name "dist" -exec echo "::set-output name=dist_folder::{}" \; | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_PAGES_TOKEN }} | |
publish_dir: ${{ steps.deploy.outputs.dist_folder }} # Use the dist folder found in the previous step |