-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (30 loc) · 1.03 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
on:
release:
types: [published]
jobs:
ci:
runs-on: ubuntu-latest
name: Update Spree On Server
steps:
- name: Create SSH key
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/private.key
sudo chmod 600 ~/.ssh/private.key
echo "$SSH_REMOTE_HOST" > ~/.ssh/known_hosts
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SERVER_SSH_KEY}}
SSH_REMOTE_HOST: ${{secrets.REMOTE_HOST}}
- uses: actions/checkout@v3
- name: Update Dependencies Using Bundle
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/private.key $SSH_REMOTE_USER@$SSH_REMOTE_HOST "
cd $REMOTE_TARGET &&
docker compose down &&
docker compose run --rm web bundle update spree_avior_tax &&
docker compose up -d;"
env:
SSH_REMOTE_USER: ${{ secrets.REMOTE_USER }}
SSH_REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_TARGET: ${{ secrets.REMOTE_TARGET }}