Simplify workflow and test on branch #12
Workflow file for this run
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 to SBIP Server | |
on: | |
push: | |
branches: | |
- cd | |
jobs: | |
deploy-to-g2-server: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: VPN into SoC network | |
run: | | |
sudo apt update && sudo apt install -y openconnect | |
echo "${{ secrets.SOC_VPN_PASSWORD }}" | sudo openconnect --protocol=fortinet staffvpn.comp.nus.edu.sg -u ${{ secrets.SOC_VPN_USERNAME }} --passwd-on-stdin --background | |
- name: SSH into SBIP Server and Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: > | |
ssh worker-111 "cd mec_anywhere && | |
git checkout cd && | |
git pull && | |
docker compose -f docker-compose-sbip.yaml build && | |
docker compose -f docker-compose-sbip.yaml up -d" |