Update subjects.json #80
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Install dependencies | |
run: | | |
cd ./client | |
npm ci | |
- name: Remove dist from .gitignore | |
run: | | |
find . -name ".gitignore" -type f -exec sed -i '/dist/d' {} + | |
- name: Update routes | |
run: | | |
find ./client -type f -exec sed -i 's|http://localhost:[0-9]\+/|https://ba-schedule.de/|' {} + | |
- name: Build client | |
run: | | |
cd ./client | |
npm run build | |
- name: Create build branch and commit | |
uses: EndBug/add-and-commit@v9 | |
with: | |
new_branch: build | |
- name: SSH into server and run setup script | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SERVER_IP }} | |
username: root | |
password: ${{ secrets.SERVER_PASSWORD }} | |
script: | | |
cd ../var/www/html/ba-schedule.de | |
bash setup.sh | |
- name: Delete build branch | |
run: | | |
git push origin --delete build |