generated from edmundhung/remix-cloudflare-template
-
Notifications
You must be signed in to change notification settings - Fork 33
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
6a7e0d4
commit 5887960
Showing
1 changed file
with
37 additions
and
55 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 |
---|---|---|
|
@@ -3,80 +3,62 @@ on: | |
- push | ||
jobs: | ||
test: | ||
name: 𧨠Trying to break it | ||
name: π Testing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node | ||
uses: actions/setup-node@v1 | ||
- 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.13 | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-npm- | ||
${{ runner.OS }}- | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright | ||
run: npx playwright install chromium --with-deps | ||
- name: Build the worker | ||
node-version: 16 | ||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
- name: π Install Playwright | ||
run: npx playwright install --with-deps | ||
- name: π¦ Build the worker | ||
run: npm run build | ||
- name: Run some tests | ||
- name: π£ Run some tests | ||
run: npm run test | ||
|
||
lint: | ||
name: π Checking the recipes | ||
name: ⬣ Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.13 | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
- name: π Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: β Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-npm- | ||
${{ runner.OS }}- | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Code format check | ||
node-version: 16 | ||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
- name: β¨ Code format check | ||
run: npx prettier --check . | ||
- name: Code linting | ||
- name: β Code linting | ||
run: npx eslint . --ext .js,.mjs,.ts,.tsx | ||
|
||
deploy: | ||
name: π³οΈ Shipping something new | ||
name: π³ Deploying | ||
needs: [test, lint] | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.13 | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
- name: π Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: β Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-npm- | ||
${{ runner.OS }}- | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Publish | ||
node-version: 16 | ||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
- name: π₯ Publish | ||
run: npx wrangler publish | ||
env: | ||
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} |