This repository has been archived by the owner on Oct 15, 2023. It is now read-only.
mobile oauth #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Deploy frontend | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: frontend/MASSter-frontend/package-lock.json | |
- run: npm ci | |
working-directory: frontend/MASSter-frontend | |
- run: cp .env.production.deploy .env.production | |
working-directory: frontend/MASSter-frontend | |
- run: npm run build | |
working-directory: frontend/MASSter-frontend | |
- name: Save build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-static | |
path: frontend/MASSter-frontend/dist | |
build2: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: frontend/MASSter-frontend/package-lock.json | |
- run: npm ci | |
working-directory: frontend/MASSter-frontend | |
- run: cp .env.production.deploy2 .env.production | |
working-directory: frontend/MASSter-frontend | |
- run: npm run build | |
working-directory: frontend/MASSter-frontend | |
- name: Save build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-static-2 | |
path: frontend/MASSter-frontend/dist | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Get build | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-static | |
path: build | |
- name: List build | |
run: ls -la build | |
- name: Deploy to server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }} | |
ARGS: "-rltgoDzvO --delete" | |
SOURCE: "build/" | |
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }} | |
REMOTE_USER: ${{ secrets.DEPLOY_USER }} | |
TARGET: ${{ secrets.DEPLOY_TARGET }} | |
deploy2: | |
runs-on: ubuntu-latest | |
needs: build2 | |
steps: | |
- name: Get build | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-static-2 | |
path: build | |
- name: List build | |
run: ls -la build | |
- name: Deploy to server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }} | |
ARGS: "-rltgoDzvO --delete" | |
SOURCE: "build/" | |
REMOTE_HOST: ${{ secrets.DEPLOY_HOST_2 }} | |
REMOTE_USER: ${{ secrets.DEPLOY_USER }} | |
TARGET: ${{ secrets.DEPLOY_TARGET }} |