[tuanm] deploy via github actions #14
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 v2 | |
on: | |
push: | |
branches: [v2-main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.3.1 | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Install dependencies | |
run: yarn install | |
- name: Build | |
run: echo "NEXT_PUBLIC_SERVER_BASE_URL=$NEXT_PUBLIC_SERVER_BASE_URL" > .env && yarn build && yarn export && touch ./build/.nojekyll | |
env: | |
NEXT_PUBLIC_SERVER_BASE_URL: ${{ vars.NEXT_PUBLIC_SERVER_BASE_URL }} | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4.4.1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: deploy/v2 | |
FOLDER: build |