-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2607ac
commit e40d4cf
Showing
1 changed file
with
28 additions
and
87 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ permissions: | |
|
||
jobs: | ||
lint: | ||
name: ⬣ ESLint | ||
name: ⬣ Biome Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: π Cancel Previous Runs | ||
|
@@ -68,98 +68,39 @@ jobs: | |
- name: π Type check | ||
run: pnpm run typecheck | ||
|
||
# vitest: | ||
# name: β‘ Vitest | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: π Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
|
||
# - name: β¬οΈ Checkout repo | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: β Setup node | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: 16 | ||
|
||
# - name: π₯ Install pnpm | ||
# uses: pnpm/action-setup@v2 | ||
# with: | ||
# version: 6.32.9 | ||
|
||
# - name: π₯ Download deps | ||
# run: pnpm install --frozen-lockfile | ||
|
||
# - name: β‘ Run vitest | ||
# run: pnpm run test -- --coverage | ||
|
||
# cypress: | ||
# name: β«οΈ Cypress | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: π Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
|
||
# - name: β¬οΈ Checkout repo | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: π Copy test env vars | ||
# run: cp .env.example .env | ||
|
||
# - name: β Setup node | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: 16 | ||
|
||
# - name: π₯ Install pnpm | ||
# uses: pnpm/action-setup@v2 | ||
# with: | ||
# version: 6.32.9 | ||
|
||
# - name: π₯ Download deps | ||
# run: pnpm install --frozen-lockfile | ||
|
||
# - name: π Setup Database | ||
# run: pnpm prisma migrate reset --force | ||
|
||
# - name: βοΈ Build | ||
# run: pnpm run build | ||
|
||
# - name: π³ Cypress run | ||
# uses: cypress-io/github-action@v5 | ||
# with: | ||
# start: pnpm run start:mocks | ||
# wait-on: "http://localhost:8811" | ||
# env: | ||
# PORT: "8811" | ||
|
||
build: | ||
name: π³ Build | ||
deploy: | ||
name: π Deploy | ||
runs-on: ubuntu-22.04 | ||
needs: [lint, typecheck] | ||
# only build/deploy main branch on pushes | ||
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: π Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
if: | ||
${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && | ||
github.event_name == 'push' }} | ||
|
||
steps: | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: π Read app name | ||
uses: SebRollen/[email protected] | ||
id: app_name | ||
with: | ||
file: "fly.toml" | ||
field: "app" | ||
|
||
- name: π³ Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Setup cache | ||
- name: β‘οΈ Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
file: 'fly.toml' | ||
field: 'app' | ||
|
||
- name: π Setup Fly | ||
uses: superfly/flyctl-actions/setup-flyctl@master | ||
|
||
- name: π Deploy Staging | ||
if: ${{ github.ref == 'refs/heads/dev' }} | ||
run: | ||
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | ||
--app ${{ steps.app_name.outputs.value }}-staging | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
|
||
- name: π Deploy Production | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |