Update build file copying in workflow #6
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'BE/**' | |
- 'FE/**' | |
- '.github/workflows/**' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install and build frontend | |
run: | | |
cd FE | |
npm install | |
CI=false npm run build | |
cd .. | |
- name: Move build files | |
run: | | |
mkdir -p deploy/client | |
cp -r BE/* deploy/ | |
cp -r FE/build deploy/client/ | |
- name: Commit and push to deploy folder | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -m "update latest build" | |
git push |