2021-04-18 09:50:01 +02:00
|
|
|
# .github/workflows/netlify.yml
|
|
|
|
name: Build and Deploy to Netlify
|
|
|
|
on:
|
|
|
|
pull_request:
|
2021-04-24 15:27:04 +02:00
|
|
|
push:
|
|
|
|
workflow_dispatch:
|
2021-04-18 09:50:01 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
2022-01-16 20:33:58 +01:00
|
|
|
node-version: 16
|
2021-04-18 09:50:01 +02:00
|
|
|
|
2021-05-24 15:20:31 +02:00
|
|
|
- run: npm ci
|
2021-05-08 21:39:59 +02:00
|
|
|
- run: npm run lint
|
|
|
|
- run: |
|
|
|
|
cat <<EOF > ./backend/.env
|
|
|
|
OPENVIDU_URL=${{ secrets.OPENVIDU_URL }}
|
|
|
|
OPENVIDU_SECRET=${{ secrets.OPENVIDU_SECRET }}
|
|
|
|
EOF
|
|
|
|
- run: cat backend/.env
|
2021-04-18 09:50:01 +02:00
|
|
|
- run: cd backend && npm ci && npm run build
|
|
|
|
env:
|
2021-11-14 20:56:10 +01:00
|
|
|
RICOCHET_SITE_KEY: ${{ secrets.RICOCHET_SECRET_KEY }}
|
2021-04-18 09:50:01 +02:00
|
|
|
- run: npm run build
|
|
|
|
env:
|
|
|
|
VITE_API_ENDPOINT: /api
|
2021-09-11 16:57:34 +02:00
|
|
|
VITE_SOCKET_URL: https://public.jeremiez.net/
|
|
|
|
VITE_SOCKET_PATH: /wamp/socket.io
|
2021-04-18 09:50:01 +02:00
|
|
|
VITE_RICOCHET_SITEID: airboardgame
|
|
|
|
VITE_USE_PROXY: 0
|
2022-01-20 21:39:10 +01:00
|
|
|
VITE_WEBCONFERENCE: audio
|
2022-03-14 23:01:28 +01:00
|
|
|
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
|
|
VITE_ENVIRONMENT: production
|
2021-04-18 09:50:01 +02:00
|
|
|
CYPRESS_INSTALL_BINARY: 0
|
|
|
|
- run: |
|
|
|
|
cat <<EOF > ./dist/_redirects
|
2022-06-13 22:44:08 +02:00
|
|
|
/api/* https://ricochetjs2.herokuapp.com/:splat 200
|
2021-04-18 09:50:01 +02:00
|
|
|
/* /index.html 200
|
|
|
|
EOF
|
|
|
|
|
|
|
|
- name: Deploy to Netlify
|
|
|
|
uses: nwtgck/actions-netlify@v1.1
|
|
|
|
with:
|
|
|
|
publish-dir: './dist'
|
|
|
|
production-branch: master
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
deploy-message: "Deploy from GitHub Actions"
|
|
|
|
enable-pull-request-comment: false
|
|
|
|
enable-commit-comment: true
|
|
|
|
overwrites-pull-request-comment: true
|
|
|
|
env:
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
timeout-minutes: 1
|