A full-featured CRM built with React, shadcn/ui, and Supabase.
Feat(ops): Add automatic deploy when pushing to main
Jonathan ARNAULTb3f72129b576
diff --git a/.github/workflows/check.yml b/.github/workflows/check.ymlindex 6cb71941..02b5d2d6 100644--- a/.github/workflows/check.yml+++ b/.github/workflows/check.yml@@ -3,7 +3,6 @@ on:push:branches:- main- - devpull_request:types:- opened@@ -23,15 +22,15 @@ permissions:jobs:lint:- name: ⬣ ESLint+ name: π ESLintruns-on: ubuntu-latesttimeout-minutes: 10if: ${{ !github.event.pull_request.draft || github.event_name == 'push' }}steps:- - name: β¬οΈ Checkout repo+ - name: π₯ Checkout repouses: actions/checkout@v4- - name: β Setup node+ - name: βοΈ Setup nodeuses: actions/setup-node@v4with:node-version: 20@@ -49,15 +48,15 @@ jobs:prettier_args: "--config ./.prettierrc.mjs \"**/*.{js,json,ts,tsx,css,md,html}\""build:- name: βοΈ Build+ name: π¨ Buildtimeout-minutes: 10runs-on: ubuntu-latestif: ${{ !github.event.pull_request.draft || github.event_name == 'push' }}steps:- - name: β¬οΈ Checkout repo+ - name: π₯ Checkout repouses: actions/checkout@v4- - name: β Setup node+ - name: βοΈ Setup nodeuses: actions/setup-node@v4with:node-version: 20@@ -66,5 +65,5 @@ jobs:- name: π₯ Download depsrun: npm install- - name: βοΈ Build+ - name: π¨ Buildrun: make builddiff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.ymlnew file mode 100644index 00000000..5b9af3d3--- /dev/null+++ b/.github/workflows/deploy.yml@@ -0,0 +1,58 @@+name: π Deploy+on:+ push:+ branches:+ - main++concurrency:+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}+ cancel-in-progress: true++permissions:+ actions: write+ contents: write+ checks: write+ pull-requests: write+++jobs:+ deploy:+ name: π Deploy+ runs-on: ubuntu-latest+ timeout-minutes: 10++ env:+ SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}+ SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}+ SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}++ steps:+ - name: π₯ Checkout repo+ uses: actions/checkout@v4++ - name: βοΈ Setup node+ uses: actions/setup-node@v4+ with:+ node-version: 20+ cache: npm++ - name: βοΈ Setup supabase+ uses: supabase/setup-cli@v1++ - name: π₯ Download deps+ run: npm install++ - name: π¨ Build+ run: make build++ - name: π Supabase Link+ run: npx supabase link --project-ref $SUPABASE_PROJECT_ID++ - name: π‘ Push supabase migrations+ run: npx supabase db push++ - name: π‘ Deploy supabase functions+ run: npx supabase functions deploy++ - name: π‘ Deploy GitHub pages+ run: npm run ghpages:deploydiff --git a/README.md b/README.mdindex 35644f57..617949bb 100644--- a/README.md+++ b/README.md@@ -87,4 +87,16 @@ make prod-startNote: It will apply migrations and deploy edge functions.-You can then access the app via [`http://localhost:3000/`](http://localhost:3000/).\ No newline at end of file+You can then access the app via [`http://localhost:3000/`](http://localhost:3000/).+++# GitHub Actions++This project supports github actions for continuous integration and delivery. To enable GitHub actions on this repo, you will+have to create the following secrets for the `deploy` environment:++```bash+SUPABASE_ACCESS_TOKEN: Your personal access token, can be found at https://supabase.com/dashboard/account/tokens+SUPABASE_DB_PASSWORD: Your supabase database password+SUPABASE_PROJECT_ID: Your supabase project id+```\ No newline at end of file