Skip to content

Commit

Permalink
add homepage deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jackchuong committed Nov 17, 2023
1 parent 11fcfc4 commit 85d6fe0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/homepage-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: deploy homepage
run-name: ${{ github.actor }} is deploying homepage 🚀
on:
workflow_dispatch:
jobs:
restart-api-service:
runs-on: ubuntu-latest
environment:
name: mainnet
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: restart homepage
uses: appleboy/[email protected]
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/${{ secrets.REMOTE_USER }}/bworks_2.0_deploy/docker-configs
docker-compose -f docker-compose.yml stop homepage
docker-compose -f docker-compose.yml rm -f homepage
cat docker-compose.template.yml > docker-compose.yml
sed -i "s|BWORKS_HOMEPAGE_TAG|${{ vars.BWORKS_HOMEPAGE_TAG }}|g" docker-compose.yml
#docker rmi -f 121427815363.dkr.ecr.ap-southeast-1.amazonaws.com/bworks:frontend-testnet
#docker rmi -f jackchuong/itl:bworks-frontend-testnet
aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin 121427815363.dkr.ecr.ap-southeast-1.amazonaws.com/bworks
docker-compose -f docker-compose.yml up -d homepage
- run: echo "🍏 This job's status is ${{ job.status }}."
3 changes: 2 additions & 1 deletion docker-configs/docker-compose.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ services:
- bworksnet

homepage:
image: jackchuong/itl:bworks-homepage-rundirect
#image: jackchuong/itl:bworks-homepage-rundirect
image: BWORKS_HOMEPAGE_TAG
container_name: homepage
restart: always
#ports:
Expand Down

0 comments on commit 85d6fe0

Please sign in to comment.