Skip to content

Simplify anchor for sharing links (#303) #197

Simplify anchor for sharing links (#303)

Simplify anchor for sharing links (#303) #197

name: Deploy 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@v4
with:
node-version: 20
- name: Install dependencies
run: |
corepack enable pnpm
pnpm install
npx playwright install --with-deps
- name: Build 'primary'
run: pnpm -F primary build
- name: Build 'ct'
run: pnpm -F ct build
- name: Test 'primary'
run: pnpm -F primary test-dist
- name: Test 'ct'
run: pnpm -F ct test-dist
- name: Archive dist/ contents
run: |
cd packages/primary/dist
tar -czf ../../../dist_contents__primary.tar.gz *
cd ../../ct/dist
tar -czf ../../../dist_contents__ct.tar.gz *
- name: Copy 'primary' 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__primary.tar.gz
target: /var/www/${{ secrets.PRN_SERVER_HOST }}/plm-staging
- name: Copy 'ct' 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__ct.tar.gz
target: /var/www/${{ secrets.PRN_SERVER_HOST }}/ct-parking-lots-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 }}/plm-staging/dist_contents__primary.tar.gz -C /var/www/${{ secrets.PRN_SERVER_HOST }}/plm-staging
rm /var/www/${{ secrets.PRN_SERVER_HOST }}/plm-staging/dist_contents__primary.tar.gz
tar -xzf /var/www/${{ secrets.PRN_SERVER_HOST }}/ct-parking-lots-staging/dist_contents__ct.tar.gz -C /var/www/${{ secrets.PRN_SERVER_HOST }}/ct-parking-lots-staging
rm /var/www/${{ secrets.PRN_SERVER_HOST }}/ct-parking-lots-staging/dist_contents__ct.tar.gz