Skip to content

Don't store the URL in core.json (#511) #210

Don't store the URL in core.json (#511)

Don't store the URL in core.json (#511) #210

name: Deploy map to staging
on:
push:
branches: [main]
jobs:
deploy_staging:
if: github.repository_owner == 'ParkingReformNetwork'
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests on dist
run: npm run test-dist
- name: Archive dist/ contents
run: |
cd dist
tar -czf ../dist_contents.tar.gz *
- name: Copy dist/ to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PRN_FTP_HOST }}
username: ${{ secrets.PRN_SERVER_USERNAME }}
key: ${{ secrets.PRN_SERVER_PRIVATE_KEY }}
source: dist_contents.tar.gz
target: /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map-staging
- name: Extract on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRN_FTP_HOST }}
username: ${{ secrets.PRN_SERVER_USERNAME }}
key: ${{ secrets.PRN_SERVER_PRIVATE_KEY }}
script: |
tar -xzf /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map-staging/dist_contents.tar.gz -C /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map-staging
rm /var/www/${{ secrets.PRN_SERVER_HOST }}/mandates-map-staging/dist_contents.tar.gz