Skip to content

Commit

Permalink
Improve GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
petervmeijgaard committed Feb 4, 2025
1 parent 077b8ba commit 20f6c40
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 44 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/ci.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: 🚀 Deploy
on:
push:
branches:
- main
pull_request: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: write
contents: read

jobs:
lint:
name: ⬣ ESLint
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ▫️ Install pnpm
uses: pnpm/[email protected]

- name: ⎔ Setup node
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: "pnpm"

- name: 📥 Download deps
shell: bash
run: pnpm install --frozen-lockfile

- name: 🔬 Lint
run: pnpm run lint

format:
name: 🎨 Prettier
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ▫️ Install pnpm
uses: pnpm/[email protected]

- name: ⎔ Setup node
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: "pnpm"

- name: 📥 Download deps
shell: bash
run: pnpm install --frozen-lockfile

- name: 🎨 Format
run: pnpm run format

deploy:
name: 🚀 Deploy
runs-on: ubuntu-22.04
needs: [lint, format]
if: ${{ github.event_name == 'pull_request' }}

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: "50"

- name: 👀 Read app name
uses: SebRollen/[email protected]
id: app_name
with:
file: "fly.toml"
field: "app"

- name: 🎈 Setup Fly
uses: superfly/flyctl-actions/[email protected]

- name: 🚀 Deploy preview environment
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

0 comments on commit 20f6c40

Please sign in to comment.