Skip to content

Commit

Permalink
ci(deploy): job to deploy new api-gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 31, 2024
1 parent f0b0abf commit c8d15f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/build-and-deploy-api-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@ jobs:
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/base:latest
- name: Build image for api-gateway
env:
NEXT_TELEMETRY_DISABLED: true
NEXT_PUBLIC_API_HOST: https://api.linkerry.com
run: docker build -t linkerry/api-gateway --build-arg NEXT_PUBLIC_API_HOST=$NEXT_PUBLIC_API_HOST -f ./apps/api-gateway/Dockerfile . --platform=linux/amd64
- name: Tag web image
run: docker tag linkerry/api-gateway registry.digitalocean.com/linkerry/api-gateway:latest
run: docker build -t registry.digitalocean.com/linkerry/api-gateway:latest -f ./apps/api-gateway/Dockerfile . --platform=linux/amd64
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/api-gateway:latest
- name: Connect to VPS and refresh docker compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_IP }}
username: root
key: ${{ secrets.SSH_PASSPHRASE_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: 22
script: |
cd api.linkerry.com/
docker-compose pull
docker compose up --force-recreate --build -d
docker-compose up -d --no-deps --build api-gateway
- name: Clear DO container registry
run: doctl registry garbage-collection start
26 changes: 0 additions & 26 deletions .github/workflows/test-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,3 @@ jobs:
echo "Connected to VPS"
uptime
touch test.txt
# name: test-ssh

# on: [push]

# jobs:
# test-job:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

# - name: Connect to DigitalOcean VPS and run commands
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.VPS_IP }}
# username: root
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# # port: 22
# script: |
# echo "Connected to VPS"
# # Place your commands here
# uptime
# touch test.txt
1 change: 1 addition & 0 deletions docs/devops/act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`act --secret-file .github/workflows/.env -j test-job`

0 comments on commit c8d15f2

Please sign in to comment.