Skip to content

Remove npm cli

Remove npm cli #755

name: Build and Publish overpass-turbo site
on:
push:
branches:
- 'main'
- 'staging'
jobs:
overpass-turbo:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Set environment variables - Staging
if: github.ref == 'refs/heads/staging'
uses: allenevans/[email protected]
with:
OVERPASS_API: overpass-api.openhistoricalmap.org
OVERPASS_BUCKET: overpass-turbo-staging.openhistoricalmap.org
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_OVERPASS_CLOUDFRONT_ID }}
- name: Set environment variables - Production
if: github.ref == 'refs/heads/main'
uses: allenevans/[email protected]
with:
OVERPASS_API: overpass-api.openhistoricalmap.org
OVERPASS_BUCKET: overpass-turbo.openhistoricalmap.org
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PRODUCTION_OVERPASS_CLOUDFRONT_ID }}
- name: Checkout overpass-turbo repo
uses: actions/checkout@v4
with:
repository: OpenHistoricalMap/overpass-turbo
ref: f4f5a0342b3d767a535febffcf9b9a1184c19ea5
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Enable Corepack
run: corepack enable
- name: Prepare Yarn 4.3.1
run: corepack prepare [email protected] --activate
- name: Install modules
run: |
yarn install
- name: Build frontend
run: |
sed -i -e 's/overpass-api.openhistoricalmap.org/'${OVERPASS_API}'/g' js/configs.ts
yarn build
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install aws cli
run: |
python -m pip install --upgrade pip
pip install awscli
- name: Push data to s3 and clean cloudfront cache
if: ${{ success() }}
run: |
aws s3 sync dist/ s3://${OVERPASS_BUCKET}/ --acl public-read
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 }}