Addresses https://github.com/OpenHistoricalMap/issues/issues/876 by d… #46
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: Staging Build | |
on: | |
push: | |
branches: | |
- staging | |
- 202408-catchup | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16' | |
- name: Yarn Install | |
run: | | |
cd frontend && yarn cache clean && yarn install | |
- name: Build | |
env: | |
TM_APP_BASE_URL: ${{ secrets.STAGING_TM_APP_BASE_URL }} | |
TM_APP_API_URL: ${{ secrets.STAGING_TM_APP_API_URL }} | |
TM_APP_API_VERSION: ${{ secrets.STAGING_TM_APP_API_VERSION }} | |
TM_ORG_NAME: ${{ secrets.STAGING_TM_ORG_NAME }} | |
TM_ORG_CODE: ${{ secrets.STAGING_TM_ORG_CODE }} | |
TM_ORG_URL: ${{ secrets.STAGING_TM_ORG_URL }} | |
TM_ORG_PRIVACY_POLICY_URL: ${{ secrets.STAGING_TM_ORG_PRIVACY_POLICY_URL }} | |
TM_ORG_TWITTER: ${{ secrets.STAGING_TM_ORG_TWITTER }} | |
TM_ORG_GITHUB: ${{ secrets.STAGING_TM_ORG_GITHUB }} | |
TM_CONSUMER_KEY: ${{ secrets.STAGING_TM_CONSUMER_KEY }} | |
TM_CONSUMER_SECRET: ${{ secrets.STAGING_TM_CONSUMER_SECRET }} | |
OSM_SERVER_URL: ${{ secrets.STAGING_OSM_SERVER_URL }} | |
OSM_REGISTER_URL: ${{ secrets.STAGING_OSM_REGISTER_URL }} | |
ID_EDITOR_URL: ${{ secrets.STAGING_ID_EDITOR_URL }} | |
POTLATCH2_EDITOR_URL: ${{ secrets.STAGING_POTLATCH2_EDITOR_URL }} | |
MAP_MAX_AREA: ${{ secrets.MAP_MAX_AREA }} | |
TM_MAX_AOI_AREA: ${{ secrets.STAGING_TM_MAX_AOI_AREA }} | |
TM_IMPORT_MAX_FILESIZE: ${{ secrets.STAGING_TM_IMPORT_MAX_FILESIZE }} | |
run: | | |
cd frontend && yarn build | |
- name: Unit Tests | |
run: | | |
cd frontend && yarn test --testPathIgnorePatterns internationalization.test.js | |
- name: Deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_STAGING_BUCKET_NAME }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
SOURCE_DIR: "frontend/build" | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.7' | |
- name: Install aws cli | |
run: | | |
python -m pip install --upgrade pip | |
pip install awscli | |
- name: Clean cache in cloudfront | |
run: | | |
aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths=/ | |
env: | |
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_CLOUDFRONT_DISTRIBUTION_ID }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} |