Skip to content

Commit

Permalink
ci(actions): all acions can deploy app
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 31, 2024
1 parent 83ef2a9 commit a119ee7
Show file tree
Hide file tree
Showing 5 changed files with 4,511 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-api-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- 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
run: doctl registry garbage-collection start --force --registry-name linkerry
deploy:
runs-on: ubuntu-latest
name: Deploy api
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/build-and-deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build-and-deploy-app
on: workflow_dispatch

jobs:
build_and_deploy:
build:
runs-on: ubuntu-latest
name: Build images
steps:
Expand Down Expand Up @@ -52,6 +52,12 @@ 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: Clear DO container registry
run: doctl registry garbage-collection start --force --registry-name linkerry
deploy:
runs-on: ubuntu-latest
name: Deploy apps
steps:
- name: Connect to VPS and refresh docker composes
uses: appleboy/[email protected]
with:
Expand All @@ -69,5 +75,3 @@ jobs:
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
10 changes: 7 additions & 3 deletions .github/workflows/build-and-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build-and-deploy-web
on: workflow_dispatch

jobs:
build_and_deploy:
build:
runs-on: ubuntu-latest
name: Build images
steps:
Expand Down Expand Up @@ -51,6 +51,12 @@ jobs:
run: docker tag linkerry/web registry.digitalocean.com/linkerry/web:latest
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/web:latest
- name: Clear DO container registry
run: doctl registry garbage-collection start --force --registry-name linkerry
deploy:
runs-on: ubuntu-latest
name: Deploy web
steps:
- name: Connect to VPS and refresh docker compose
uses: appleboy/[email protected]
with:
Expand All @@ -64,5 +70,3 @@ jobs:
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
1 change: 1 addition & 0 deletions docs/env/load-env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`node --env-file=.env -r ts-node/register tools/devops/digital-ocean-firewall.ts`
Loading

0 comments on commit a119ee7

Please sign in to comment.