Merge pull request #40 from buerokratt/dev #11
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
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: Pull Docker Image | |
run: | | |
ssh -i $HOME/.ssh/id_rsa ubuntu@${{ secrets.TEST_SERVER_IP }} docker pull ghcr.io/buerokratt/tim:2.0.230816074750 | |
- name: Update Docker Compose File | |
run: | | |
ssh -i $HOME/.ssh/id_rsa ubuntu@${{ secrets.TEST_SERVER_IP }} 'cd /home/ubuntu/install/Installation-Guides/default-setup/backoffice-and-bykstack/ && sed -i "s|image: test|image: ghcr.io/buerokratt/tim:2.0.230816074750|g" 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' | |