-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |