-
Notifications
You must be signed in to change notification settings - Fork 9
32 lines (27 loc) · 1.25 KB
/
test-deploy.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
32
name: Deploy TIM
on:
push:
branches:
- test
jobs:
deploy-dev-test:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/test' # Only run for the 'feature' branch
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.TIM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.TEST_SERVER_IP }} >> ~/.ssh/known_hosts
- name: Push Docker Image
run: |
ssh -i $HOME/.ssh/id_rsa ubuntu@${{ secrets.TEST_SERVER_IP }} docker push ghcr.io/buerokratt/tim:2.0.230816074750
- name: Update Docker Compose File
run: |
ssh -i $HOME/.ssh/id_rsa ubuntu@${{ secrets.TEST_SERVER_IP }} sed -i 's#service tim image: test#service tim image: ghcr.io/buerokratt/tim:2.0.230816074750#' /home/ubuntu/install/Installation-Guides/default-setup/backoffice-and-bykstack/docker-compose.yml
- name: Run Docker Compose on TEST server
run: |
ssh -i $HOME/.ssh/id_rsa ubuntu@${{ secrets.TEST_SERVER_IP }} 'cd /home/ubuntu/install/Installation-Guides/default-setup/backoffice-and-bykstack && docker-compose down && docker-compose up -d --build'