32 lines
816 B
YAML
32 lines
816 B
YAML
name: Deploy Canina
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: canina
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Setup SSH key
|
|
shell: sh
|
|
env:
|
|
SSH_KEY: ${{ secrets.DEPLOY_KEY }}
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "$SSH_KEY" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan -p 2234 -H 172.17.0.1 >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy with VPN for build
|
|
shell: sh
|
|
timeout-minutes: 20
|
|
env:
|
|
BRANCH: ${{ github.ref_name }}
|
|
run: |
|
|
echo "Deploying branch: ${BRANCH}"
|
|
ssh -o StrictHostKeyChecking=no -p 2234 devops@172.17.0.1 \
|
|
"bash /opt/services/scripts/with-vpn.sh \"bash /opt/services/canina/deploy.sh ${BRANCH}\"" |