Merge pull request #47 from developmentseed/feature/GithubLink #51
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
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
NODE: 18 | |
WORKING_DIRECTORY: packages/web | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ env.NODE }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE }} | |
cache: "yarn" | |
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/yarn.lock | |
- name: Install Dependencies | |
run: yarn install | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
- name: Lint | |
run: yarn lint | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
- name: Configure AWS credentials using OIDC | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::003081160852:role/osm-gradient-deploy-s3-role | |
aws-region: us-east-1 | |
- name: Build | |
run: npx vite build | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
- name: Deploy to S3 | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
run: aws s3 sync ./dist s3://gradient.osmcha.org --delete |