Skip to content

Fix URL secret

Fix URL secret #60

name: Deploy to production env
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Install SSH Key
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-host: ${{ secrets.SSH_HOST_NEW_IP }}
ssh-port: ${{ secrets.SSH_HOST_NEW_PORT }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node JS
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run TypeScript typecheck
run: npm run typecheck
- name: Set git commit
run: echo "VITE_GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build app
env:
VITE_ENV: production
VITE_OSM_API_URL: ${{ secrets.REACT_APP_OSM_API_URL }}
VITE_OSM_OAUTH2_CLIENT_ID: ${{ secrets.REACT_APP_OSM_OAUTH2_CLIENT_ID }}
VITE_OSM_OAUTH2_CLIENT_SECRET: ${{ secrets.REACT_APP_OSM_OAUTH2_CLIENT_SECRET }}
VITE_BACKEND_API_URL: ${{ secrets.VITE_BACKEND_API_URL_NEW }}
run: npm run build
- name: Create robots.txt
run: touch build/robots.txt
- name: Run deploy script on host
run: |
scp -rp -P${{ secrets.SSH_HOST_NEW_PORT }} build/* ${{ secrets.SSH_USER_NEW }}@${{ secrets.SSH_HOST_NEW_IP }}:~/prod-static/