25 move project to nextjs (#27) #40
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 website | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
DevDeploy: | |
name: Build and deploy for prod | |
if: github.event.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
environment: | |
name: development | |
url: https://alex-dishen.web.app | |
steps: | |
- uses: actions/checkout@v3 | |
- run: yarn i && yarn build | |
- uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: '${{ secrets.GITHUB_TOKEN }}' | |
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ALEX_DISHEN }}' | |
channelId: live | |
projectId: alex-dishen | |
ProdDeploy: | |
name: Build and deploy for dev | |
if: github.event.ref == 'refs/heads/develop' | |
environment: | |
name: github-pages | |
url: https://alex-dishen.github.io/portfolio/ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
- name: Install dependencies | |
run: yarn | |
- name: Build project | |
run: yarn build | |
- name: Upload production-ready build files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: production-files | |
path: ./out | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: production-files | |
path: ./out | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./out |