-
Notifications
You must be signed in to change notification settings - Fork 27
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
2a356c7
commit a18fd4d
Showing
4 changed files
with
83 additions
and
10 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Basic Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: npm | ||
|
||
- name: Configure AWS Credentials | ||
uses: mapbox/configure-aws-credentials-internal@v5 | ||
with: | ||
target-account-id: ${{ vars.AWS_ACCOUNT_ID_DEFAULT }} | ||
|
||
- name: Retrieve and configure npm token | ||
uses: mapbox/setup-npm-token@v2 | ||
|
||
- name: Install npm dependencies | ||
run: npm ci --no-fund --no-audit --prefer-offline | ||
|
||
- name: Test | ||
run: npm test |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [staging, production] | ||
|
||
env: | ||
bucket: '{ "staging": "labs.mapbox.com-staging/assembly", "production": "labs.mapbox.com/assembly" }' | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to ${{ matrix.environment }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
strategy: | ||
matrix: | ||
environment: [staging, production] | ||
exclude: | ||
- environment: ${{ github.ref_name != 'staging' && 'staging' }} | ||
- environment: ${{ github.ref_name != 'production' && 'production' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: npm | ||
|
||
- name: Configure AWS Credentials | ||
uses: mapbox/configure-aws-credentials-internal@v5 | ||
with: | ||
target-account-id: ${{ vars.AWS_ACCOUNT_ID_DEFAULT }} | ||
|
||
- name: Retrieve and configure npm token | ||
uses: mapbox/setup-npm-token@v2 | ||
|
||
- name: Install npm dependencies | ||
run: npm ci --no-fund --no-audit --prefer-offline | ||
|
||
- name: Build for ${{ matrix.environment }} | ||
run: npm run build | ||
|
||
- name: Sync files ${{ matrix.environment }} | ||
run: aws s3 sync _site ${{ env.targetBucket }} --exclude "*.html" --exclude "*.xml" --cache-control "max-age=31536000" | ||
env: | ||
targetBucket: s3://${{ fromJson(env.bucket)[matrix.environment] }} | ||
|
||
- name: Sync html files to ${{ matrix.environment }} | ||
run: aws s3 sync _site ${{ env.targetBucket }} --exclude "*" --include "*.html" --include "*.xml" --cache-control "max-age=10,stale-while-revalidate=60" | ||
env: | ||
targetBucket: s3://${{ fromJson(env.bucket)[matrix.environment] }} |
This file was deleted.
Oops, something went wrong.