Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
Updated deploy.yml to work with the encrypted file
  • Loading branch information
alitpc25 authored Nov 25, 2023
1 parent a30a9dd commit eb438e2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Decrypt and Extract project_env_prod
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$RESQ_PASSPHRASE" --output project_env_prod.tar.gz project_env_prod.tar.gz.gpg
tar xzvf project_env_prod.tar.gz
env:
RESQ_PASSPHRASE: ${{ secrets.RESQ_PASSPHRASE }}

- name: Set up Docker
uses: actions/setup-docker@v2
with:
dockerfile: ../../resq/backend/resq/Dockerfile.remote

- name: Build and Push Docker Image
run: |
docker build -t resq:latest -f ../../resq/backend/resq/Dockerfile.remote ../../resq/backend/resq/
docker build -t alitpc2525/resq:latest -f ../../resq/backend/resq/Dockerfile.remote ../../resq/backend/resq/
docker login -u alitpc2525 -p ${{ secrets.DOCKER_PASSWORD }}
docker tag resq:latest alitpc2525/resq:latest
docker tag alitpc2525/resq:latest alitpc2525/resq:latest
docker push alitpc2525/resq:latest
- name: SSH into AWS EC2
Expand All @@ -35,5 +42,5 @@ jobs:
sudo service docker start
sudo docker rm -f $(sudo docker ps -q)
sudo docker pull alitpc2525/resq:latest
sudo docker run -d -p 443:8081 -v /home/ec2-user/certbot/keystore.p12:/app/keystore.p12 alitpc2525/resq:latest
sudo docker run -d -p 443:8081 -v /home/ec2-user/certbot/keystore.p12:/app/keystore.p12 -v $(pwd)/project_env_prod:/app/project_env_prod alitpc2525/resq:latest
sudo docker ps

0 comments on commit eb438e2

Please sign in to comment.