fix: reading callback url from env (#3) #3
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: Test Instance Deployment | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
name: updates... | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remote Connection Setup | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.CICD_HOST }} | |
username: ${{ secrets.CICD_USERNAME }} | |
key: ${{ secrets.CICD_SECRET }} | |
port: ${{ secrets.PORT }} | |
script: | | |
# Set up deployment directory | |
deploy_dir="/apps/githubworkflows/mhealth/payments-aggregator" | |
sudo rm -rf "$deploy_dir" | |
sudo mkdir "$deploy_dir" | |
sudo chown -R cicd:cicd "$deploy_dir" | |
# Clone repository | |
git config --global --add safe.directory "$deploy_dir" | |
git clone -b main https://github.com/palladiumkenya/payments-aggregator.git "$deploy_dir" | |
# Copy configuration files | |
cp /apps/workflowConfigs/payments-aggregator/.env "$deploy_dir/" | |
# Build and run Docker container | |
docker stop payments_aggregator || true | |
docker rm payments_aggregator || true | |
docker build -t payments_aggregator:latest "$deploy_dir" | |
docker run -p 7332:3000 --name payments_aggregator -d --restart always payments_aggregator:latest |