Bun for deployment #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 Frontend to Github Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js (and Bun) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Bun | |
run: | | |
curl -fsSL https://bun.sh/install | bash | |
export BUN_INSTALL="$HOME/.bun" | |
export PATH="$BUN_INSTALL/bin:$PATH" | |
- name: Install Frontend dependencies | |
run: | | |
cd frontend | |
bun install | |
- name: Create .env file | |
run: | | |
cd frontend | |
echo "NEXT_PUBLIC_SERVER=${{ secrets.NEXT_PUBLIC_SERVER }}" >> .env | |
echo "INFURA_IPFS_ID=${{ secrets.INFURA_IPFS_ID }}" >> .env | |
echo "INFURA_IPFS_SECRET=${{ secrets.INFURA_IPFS_SECRET }}" >> .env | |
- name: Build Frontend Next.js website | |
run: | | |
cd frontend | |
bun run build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./frontend/out |