Update osm-seed - minute replication liveness (#735) #2126
This file contains hidden or 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 Publish tasking-manager site | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'staging' | |
| jobs: | |
| tm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.8.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Set environment variables - Common | |
| uses: allenevans/set-env@v4.0.0 | |
| with: | |
| TM_ORG_NAME: OpenHistoricalMap | |
| TM_ORG_CODE: OHM | |
| TM_ORG_TWITTER: https://twitter.com/OpenHistMap | |
| TM_ORG_GITHUB: https://github.com/openhistoricalmap | |
| TM_EMAIL_FROM_ADDRESS: admin@openhistoricalmap.org | |
| TM_EMAIL_CONTACT_ADDRESS: admin@openhistoricalmap.org | |
| TM_DEFAULT_LOCALE: en | |
| TM_IMPORT_MAX_FILESIZE: 3e+06 | |
| TM_MAX_AOI_AREA: 15000 | |
| TM_SCOPE: "read_prefs write_api" | |
| TM_DEFAULT_CHANGESET_COMMENT: '#ohm-project' | |
| - name: Set environment variables - Staging | |
| if: github.ref == 'refs/heads/staging' | |
| uses: allenevans/set-env@v4.0.0 | |
| with: | |
| TM_ORG_URL: https://staging.openhistoricalmap.org | |
| TM_ORG_PRIVACY_POLICY_URL: https://staging.openhistoricalmap.org/copyright | |
| OSM_SERVER_URL: https://staging.openhistoricalmap.org | |
| OSM_NOMINATIM_SERVER_URL: https://nominatim-api.staging.openhistoricalmap.org | |
| OSM_REGISTER_URL: https://staging.openhistoricalmap.org/user/new | |
| ID_EDITOR_URL: https://staging.openhistoricalmap.org/edit?editor=id | |
| POTLATCH2_EDITOR_URL: https://staging.openhistoricalmap.org/edit?editor=potlatch2 | |
| TM_APP_API_URL: https://tm-api.staging.openhistoricalmap.org | |
| TM_APP_BASE_URL: https://tasks.staging.openhistoricalmap.org | |
| TM_CLIENT_ID: EeFtCc-qwJEsKZWrD1jFQZfPHp5JpRq-da9jw55z86U | |
| TM_CLIENT_SECRET: g0TLdrT-IAu8VEhyuvJ_YBMWWUhSXXO75SpTxG2P3OI | |
| TM_REDIRECT_URI: https://tasks.staging.openhistoricalmap.org/authorized | |
| TM_APP_API_VERSION: v2 | |
| AWS_S3_BUCKET: tasks-staging.openhistoricalmap.org | |
| CLOUDFRONT_DISTRIBUTION_ID: E38F009PE1FJVW | |
| REACT_APP_HOMEPAGE_STATS_API_URL: https://tm-api.staging.openhistoricalmap.org/api/v2/system/statistics/ | |
| - name: Set environment variables - Production | |
| if: github.ref == 'refs/heads/main' | |
| uses: allenevans/set-env@v4.0.0 | |
| with: | |
| TM_ORG_URL: https://www.openhistoricalmap.org | |
| TM_ORG_PRIVACY_POLICY_URL: https://www.openhistoricalmap.org/copyright | |
| OSM_SERVER_URL: https://www.openhistoricalmap.org | |
| OSM_NOMINATIM_SERVER_URL: https://nominatim-api.openhistoricalmap.org | |
| OSM_REGISTER_URL: https://www.openhistoricalmap.org/user/new | |
| ID_EDITOR_URL: https://www.openhistoricalmap.org/edit?editor=id | |
| POTLATCH2_EDITOR_URL: https://www.openhistoricalmap.org/edit?editor=potlatch2 | |
| TM_APP_API_URL: https://tm-api.openhistoricalmap.org | |
| TM_APP_BASE_URL: https://tasks.openhistoricalmap.org | |
| TM_CLIENT_ID: 2L3O78gSiOX6HHYa-Ktv7ckJqI-qGy3GxkgEf9b5FsM | |
| TM_CLIENT_SECRET: nQ-QkUiMftNm0yXRrKcZgrdjo4zkAfQWObTVxDECqNM | |
| TM_REDIRECT_URI: https://tasks.openhistoricalmap.org/authorized | |
| TM_APP_API_VERSION: v2 | |
| AWS_S3_BUCKET: tasks.openhistoricalmap.org | |
| CLOUDFRONT_DISTRIBUTION_ID: E2J02LH05GBWB0 | |
| REACT_APP_HOMEPAGE_STATS_API_URL: https://tm-api.staging.openhistoricalmap.org/api/v2/system/statistics/ | |
| - name: Checkout tasking-manager repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: OpenHistoricalMap/tasking-manager | |
| ref: fc935876d43430c55c2c74601c6b46d1e3eda8fa | |
| path: tasking-manager | |
| - name: Debug Checkout | |
| run: ls -la tasking-manager | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: npm Install and Build | |
| run: | | |
| cd tasking-manager/frontend | |
| npm install | |
| npm install --save-dev @craco/craco | |
| npm run preparation | |
| npm run update-static | |
| npm run update-id-static | |
| npm run patch-rapid | |
| npx craco build | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - name: Install aws cli | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install awscli | |
| - name: Sync to S3 and clean cache in cloudfront | |
| if: ${{ success() }} | |
| run: | | |
| aws s3 sync tasking-manager/frontend/build s3://${AWS_S3_BUCKET} --acl public-read --delete | |
| aws cloudfront create-invalidation --distribution-id=${CLOUDFRONT_DISTRIBUTION_ID} --paths=/ | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |