Skip to content

Commit

Permalink
Create test-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KlviG authored Aug 16, 2023
1 parent ba86f5d commit 6f14853
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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'

0 comments on commit 6f14853

Please sign in to comment.