Build for Testing and Production #17
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
name: Build and Deploy Frontend to Production Branch | |
on: | |
workflow_dispatch: {} | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "gowribhat" | |
- name: Checkout code (production) | |
uses: actions/checkout@v4 | |
with: | |
ref: production-actions-test | |
- name: Checkout code (master) | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
working-directory: ./frontend-service | |
- name: Build frontend (master) | |
run: | | |
export REACT_APP_QUESTIONS_SERVICE_HOST=http://peerprep.bryanlohxz.com/api/questions-service | |
export REACT_APP_USERS_SERVICE_HOST=http://peerprep.bryanlohxz.com/api/users-service | |
export REACT_APP_MATCHMAKING_SERVICE_HOST=http://peerprep.bryanlohxz.com/api/matchmaking-service | |
export CI=false | |
yarn build | |
working-directory: ./frontend-service | |
- name: Update build in production | |
run: | | |
git add -f build | |
git commit -m "Update build" | |
git push -f origin HEAD:production-actions-test | |
working-directory: ./frontend-service |