All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 25s
33 lines
1 KiB
YAML
33 lines
1 KiB
YAML
name: Deploy Beta (NATIVE)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- beta
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Package Application
|
|
run: |
|
|
tar -czf app.tar.gz --exclude=.git --exclude=node_modules --exclude=logs --exclude=.turbo --exclude=.output .
|
|
|
|
- name: Deploy to cisystem EC2
|
|
run: |
|
|
apk add --no-cache openssh-client
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.BETA_EC2_SSH_KEY }}" > ~/.ssh/id_rsa
|
|
chmod 600 ~/.ssh/id_rsa
|
|
|
|
CISYSTEM_HOST="172.31.15.84"
|
|
CISYSTEM_USER="ubuntu"
|
|
|
|
# Copy app archive and systemd service files to cisystem
|
|
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa app.tar.gz getcito.service getcito-worker.service ${CISYSTEM_USER}@${CISYSTEM_HOST}:/tmp/
|
|
|
|
# Execute deployment commands on cisystem
|
|
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${CISYSTEM_USER}@${CISYSTEM_HOST} "bash -s" < deploy.sh
|