-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(jobs): devide actions to teo jobs
- Loading branch information
Showing
4 changed files
with
33 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: build-and-deploy-api-gateway | |
on: workflow_dispatch | ||
|
||
jobs: | ||
build_and_deploy: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build images | ||
steps: | ||
|
@@ -45,6 +45,12 @@ jobs: | |
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: Clear DO container registry | ||
run: doctl registry garbage-collection start | ||
deploy: | ||
runs-on: ubuntu-latest | ||
name: Deploy api | ||
steps: | ||
- name: Connect to VPS and refresh docker compose | ||
uses: appleboy/[email protected] | ||
with: | ||
|
@@ -55,7 +61,6 @@ jobs: | |
port: 22 | ||
script: | | ||
cd api.linkerry.com/ | ||
docker-compose pull | ||
docker-compose up -d --no-deps --build api-gateway | ||
- name: Clear DO container registry | ||
run: doctl registry garbage-collection start | ||
docker compose pull | ||
docker compose up -d --no-deps --build api-gateway | ||
docker image prune -f |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,3 +52,22 @@ jobs: | |
run: docker build -t registry.digitalocean.com/linkerry/web:latest --build-arg NEXT_PUBLIC_API_HOST=$NEXT_PUBLIC_API_HOST -f ./apps/web/Dockerfile . --platform=linux/amd64 | ||
- name: Push image to DO Container Registry | ||
run: docker push registry.digitalocean.com/linkerry/web:latest | ||
- name: Connect to VPS and refresh docker composes | ||
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 -d --no-deps --build api-gateway | ||
cd .. | ||
cd linkerry.com/ | ||
docker compose pull | ||
docker compose up -d --no-deps --build web | ||
docker image prune -f | ||
- name: Clear DO container registry | ||
run: doctl registry garbage-collection start |
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
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