Skip to content

Commit

Permalink
add CI actions for lints and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish21 committed Jun 11, 2022
1 parent e49cefd commit 13ae74e
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🧪 CI
on: [push, pull_request]

jobs:
lint:
name: ⬣ ESLint
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.7.0

- name: 📥 Download deps
uses: bahmutov/npm-install@v1

- name: 🔬 Lint
run: npm run lint

typecheck:
name: ʦ Typecheck
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.7.0

- name: 📥 Download deps
uses: bahmutov/npm-install@v1

- name: 🔎 Type check
run: npm run typecheck
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 🕊 Deploy
on:
push:
branches:
- master

jobs:
deploy:
if: github.repository == 'Girish21/remix-cloudflare-workers-template'
runs-on: ubuntu-latest
name: 🕊 Deploy
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: 📥 Install deps
uses: bahmutov/npm-install@v1

- name: 📦 Build
run: npm run build

- name: 🚀 Publish
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: 'packages/worker'
command: publish
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dev": "npx --yes turbo run dev --parallel",
"lint": "npx --yes turbo run lint",
"typecheck": "npx --yes turbo run typecheck",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,md}\""
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,md,yml}\""
},
"devDependencies": {
"prettier": "latest",
Expand Down

0 comments on commit 13ae74e

Please sign in to comment.