-
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.
build: bump node version to latest lts 18
This commit bumps the Node.js engine specified in `package.json` to be the latest LTS (18) and updates the Dockerfile and actions accordingly. This change should also speed up CI as dependencies are now cached properly by the setup node action instead of the previously buggy [[1]] install dependencies action. [1]: bahmutov/npm-install#146
- Loading branch information
1 parent
e1f710e
commit 2bd59df
Showing
4 changed files
with
34 additions
and
28 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 |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
name: ESLint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout repo | ||
|
@@ -24,10 +24,11 @@ jobs: | |
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- name: Download deps | ||
uses: bahmutov/npm-install@v1 | ||
run: yarn install --immutable | ||
|
||
# Linting fails in CI because `~/styles/tailwind.css` does not exist and | ||
# thus my `import/order` rule errors (because it doesn't mark that as a | ||
|
@@ -42,7 +43,7 @@ jobs: | |
name: TypeScript | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout repo | ||
|
@@ -51,10 +52,11 @@ jobs: | |
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- name: Download deps | ||
uses: bahmutov/npm-install@v1 | ||
run: yarn install --immutable | ||
|
||
- name: Type check | ||
run: yarn typecheck | ||
|
@@ -63,7 +65,7 @@ jobs: | |
name: Vitest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout repo | ||
|
@@ -72,10 +74,11 @@ jobs: | |
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- name: Download deps | ||
uses: bahmutov/npm-install@v1 | ||
run: yarn install --immutable | ||
|
||
- name: Run vitest | ||
run: yarn test -- --coverage | ||
|
@@ -84,7 +87,7 @@ jobs: | |
name: Cypress | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout repo | ||
|
@@ -96,18 +99,19 @@ jobs: | |
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- name: Download deps | ||
uses: bahmutov/npm-install@v1 | ||
run: yarn install --immutable | ||
|
||
- name: Docker compose | ||
# the sleep is just there to give time for postgres to get started | ||
run: docker-compose up -d && sleep 3 | ||
env: | ||
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/postgres' | ||
|
||
- name: Setup Database | ||
- name: Setup database | ||
run: yarn prisma migrate reset --force | ||
|
||
- name: Build | ||
|
@@ -130,7 +134,7 @@ jobs: | |
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod') && github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout repo | ||
|
@@ -143,19 +147,19 @@ jobs: | |
file: 'fly.toml' | ||
field: 'app' | ||
|
||
- name: Set up Docker Buildx | ||
- name: Set up docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Setup cache | ||
- name: Cache Docker layers | ||
- name: Cache docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Fly Registry Auth | ||
- name: Fly registry auth | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: registry.fly.io | ||
|
@@ -191,7 +195,7 @@ jobs: | |
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod') && github.event_name == 'push' }} | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout repo | ||
|
@@ -204,15 +208,15 @@ jobs: | |
file: 'fly.toml' | ||
field: 'app' | ||
|
||
- name: Deploy Staging | ||
- name: Deploy staging | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: superfly/[email protected] | ||
with: | ||
args: 'deploy --app ${{ steps.app_name.outputs.value }}-staging --image registry.fly.io/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }}' | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
|
||
- name: Deploy Production | ||
- name: Deploy production | ||
if: ${{ github.ref == 'refs/heads/prod' }} | ||
uses: superfly/[email protected] | ||
with: | ||
|
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
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
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