Skip to content

Commit 2fc4e47

Browse files
Version 7
Update for version 7
2 parents d5d7925 + 02562f4 commit 2fc4e47

24 files changed

+12182
-10937
lines changed

.eslintrc

Lines changed: 0 additions & 118 deletions
This file was deleted.

.github/_workflow-samples/README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,21 @@ This workflow gets triggered with every push to the main branch, and doesn't ver
1515
- add the bucket name as an evironemnt variable (`DEPLOY_BUCKET`) to the deploy workflow. Omit `s3://` from the bucket name.
1616

1717
## Serving site from sub-path
18-
This workflow assumes that the site is served from the root of the URL (eg. devseed.com). To support a URL served from a sub-path (eg. devseed.com/explorer), replace the `yarn build` step in the build job with the following steps:
18+
This workflow assumes that the site is served from the root of the URL (eg. devseed.com). To support a URL served from a sub-path (eg. devseed.com/explorer), add the following step:
1919

2020
```
21-
- name: Build
22-
run: PUBLIC_URL="https://devseed.com/explorer" yarn build
23-
2421
- name: Serve site from subpath
2522
run: |
2623
cd dist
27-
mkdir explorer
28-
mv assets explorer/assets
29-
cp index.html explorer
24+
mkdir <subfolder>
25+
mv assets <subfolder>/assets
26+
cp index.html <subfolder>
3027
```
3128

32-
# `deploy-surge-yml`
33-
A workflow that builds the site and deploys it to Surge.
29+
# `deploy-gh-yml`
30+
A workflow that builds the site and deploys it to Github pages.
3431

3532
This workflow gets triggered with every push to the main branch, and doesn't verify if the checks were successful. It relies on branch protection to do so.
3633

37-
## First-time setup
38-
- create a user on Surge
39-
- add the secret token from Surge as [an encrypted secret to the project repository](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository). Use `SURGE_TOKEN`
40-
- add `SURGE_DOMAIN` to the `deploy.yml`. This ensure the app is deployed to the same domain every time.
34+
# S3 previews
35+
Check the [Implementing S3 deploy previews](https://github.com/developmentseed/how/issues/423) guide to set up S3 previews for feature branches.
Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
2-
# Deploy the site to Surge on a push to the 'main' branch
3-
4-
name: Deploy Surge
1+
name: Deploy Github Pages
52

63
on:
74
push:
85
branches:
96
- 'main'
107

118
env:
12-
NODE: 18
13-
SURGE_DOMAIN:
9+
PUBLIC_URL: ${{ vars.PUBLIC_URL }}
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: write
1417

1518
jobs:
1619
build:
1720
runs-on: ubuntu-latest
1821

1922
steps:
20-
- name: Cancel Previous Runs
21-
uses: styfle/[email protected]
22-
with:
23-
access_token: ${{ github.token }}
24-
2523
- name: Checkout
26-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2725

28-
- name: Use Node.js ${{ env.NODE }}
26+
- name: Use Node.js
2927
uses: actions/setup-node@v3
3028
with:
31-
node-version: ${{ env.NODE }}
29+
node-version-file: '.nvmrc'
3230

3331
- name: Cache node_modules
3432
uses: actions/cache@v3
@@ -45,34 +43,30 @@ jobs:
4543
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
4644

4745
- name: Install
48-
run: yarn install
46+
run: npm install
4947

5048
- name: Build
51-
run: yarn build
49+
run: npm run all:build
5250

5351
deploy:
5452
runs-on: ubuntu-latest
5553
needs: build
5654

5755
steps:
5856
- name: Checkout
59-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
6058

61-
- name: Restore node_modules
62-
uses: actions/cache@v3
63-
id: cache-node-modules
64-
with:
65-
path: node_modules
66-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
67-
6859
- name: Restore dist cache
6960
uses: actions/cache@v3
7061
id: cache-dist
7162
with:
7263
path: dist
7364
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
7465

75-
- name: Deploy to Surge
76-
run: |
77-
cp ./dist/index.html ./dist/200.html
78-
node_modules/surge/lib/cli.js ./dist ${{ env.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}
66+
- name: Deploy 🚀
67+
uses: JamesIves/github-pages-deploy-action@v4
68+
with:
69+
branch: gh-pages
70+
clean: true
71+
single-commit: true
72+
folder: /dist

.github/workflows/checks.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,20 @@ on:
1818
- ready_for_review
1919

2020
env:
21-
NODE: 18
21+
NODE: 20
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
2226

2327
jobs:
2428
prep:
2529
if: github.event.pull_request.draft == false
2630
runs-on: ubuntu-latest
2731

2832
steps:
29-
- name: Cancel Previous Runs
30-
uses: styfle/[email protected]
31-
with:
32-
access_token: ${{ github.token }}
33-
3433
- name: Checkout
35-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3635

3736
- name: Use Node.js ${{ env.NODE }}
3837
uses: actions/setup-node@v3
@@ -47,15 +46,15 @@ jobs:
4746
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
4847

4948
- name: Install
50-
run: yarn install
49+
run: npm install
5150

5251
lint:
5352
needs: prep
5453
runs-on: ubuntu-latest
5554

5655
steps:
5756
- name: Checkout
58-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5958

6059
- name: Use Node.js ${{ env.NODE }}
6160
uses: actions/setup-node@v3
@@ -70,18 +69,18 @@ jobs:
7069
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
7170

7271
- name: Install
73-
run: yarn install
72+
run: npm install
7473

7574
- name: Lint
76-
run: yarn lint
75+
run: npm run lint
7776

7877
test:
7978
needs: prep
8079
runs-on: ubuntu-latest
8180

8281
steps:
8382
- name: Checkout
84-
uses: actions/checkout@v3
83+
uses: actions/checkout@v4
8584

8685
- name: Use Node.js ${{ env.NODE }}
8786
uses: actions/setup-node@v3
@@ -96,7 +95,7 @@ jobs:
9695
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
9796

9897
- name: Install
99-
run: yarn install
98+
run: npm install
10099

101100
- name: Test
102-
run: yarn test
101+
run: npm run test

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

.parcelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"extends": ["@parcel/config-default"],
3-
"reporters": ["...", "@parcel/reporter-bundle-analyzer"]
3+
"reporters": ["...", "@parcel/reporter-bundle-analyzer"],
4+
"resolvers": ["parcel-resolver-ignore", "..."]
45
}

0 commit comments

Comments
 (0)