Dockerize Nextjs #219
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 | |
on: | |
push: | |
branches: | |
- main | |
# TODO: Remove me when merge to main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
web: | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π¦ Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: π’ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
cache-dependency-path: ./pnpm-lock.yaml | |
- name: π¦ Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: πͺ° Setup Fly | |
uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: π Deploy | |
run: flyctl deploy --config apps/web/fly.toml --dockerfile apps/web/Dockerfile --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
api: | |
runs-on: ubuntu-latest | |
# TODO: Remove me when merge to main | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π¦ Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: π’ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
cache-dependency-path: ./pnpm-lock.yaml | |
- name: π¦ Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: πͺ° Setup Fly | |
uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: π Deploy | |
run: flyctl deploy --config apps/api/fly.toml --dockerfile apps/api/Dockerfile --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |