Repository navigation
feat(projects): add new projects, images, and reorder #12
This file contains hidden or 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 & Deploy (main -> gh-pages (prod)) | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Write env.json (prod) | |
| run: | | |
| mkdir -p public | |
| cat <<EOF > public/env.json | |
| {"env":"prod","sha":"${{ github.sha }}"} | |
| EOF | |
| - name: Build | |
| run: npm run build | |
| - name: Deploy to gh-pages (prod, manual) | |
| env: | |
| REPO: ${{ github.repository }} | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SHA: ${{ github.sha }} | |
| run: | | |
| set -e | |
| mkdir out | |
| cd out | |
| git init -b gh-pages | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git remote add origin https://x-access-token:${TOKEN}@github.com/${REPO} | |
| cp -r ../dist/. . | |
| git add -A | |
| git commit -m "ci: deploy to gh-pages (prod) - ${SHA}" | |
| git push origin gh-pages --force |