Merge pull request #870 from johnson-oragui/fix/password-change-and-s… #1
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: Dev cd pipeline | |
on: | |
push: | |
branches: [dev] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build image | |
run: docker build -t anchor-python-bp-dev:latest -f Dockerfile . | |
- name: Save image | |
run: docker save anchor-python-bp-dev:latest | gzip > dev.tar.gz | |
- name: Copy image to server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
source: "dev.tar.gz" | |
target: "/home/${{ secrets.USERNAME }}/boilerplate-python/dev_source_code" | |
- name: Deploy image on server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
cd /home/${{ secrets.USERNAME }}/boilerplate-python/dev_source_code | |
git pull origin dev | |
docker load --input dev.tar.gz | |
docker compose -f docker-compose.yml up -d | |
rm -f dev.tar.gz | |