Skip to content

Commit

Permalink
feat(ci): action to deploy whole app
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 25, 2024
1 parent d81c603 commit 63e17c9
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: build-and-deploy
name: build-and-deploy-api-gateway

on: workflow_dispatch
# on:
# push:
# branches:
# - master

jobs:
build_and_deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -33,20 +30,24 @@ jobs:
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('package.json') }}
# - name: Build base image
# run: npm run docker-base-linux
- name: Build base image
run: npm run docker-base-linux
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
# - name: Push image to DO Container Registry
# run: docker push registry.digitalocean.com/linkerry/base:latest
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/base:latest
- name: Build image for api-gateway
run: docker build -t registry.digitalocean.com/linkerry/api-gateway:latest --build-arg NEXT_PUBLIC_API_HOST=$NEXT_PUBLIC_API_HOST -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: Build image for web
run: docker build -t linkerry/web -f ./apps/web/Dockerfile . --platform=linux/amd64
- name: Tag web image
run: docker tag linkerry/web registry.digitalocean.com/linkerry/web:latest
env:
NEXT_TELEMETRY_DISABLED: true
NEXT_PUBLIC_API_HOST: https://api.linkerry.com
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
# - run: npx [email protected] affected -t docker-compose --base=origin/master~1 --head=origin/master

0 comments on commit 63e17c9

Please sign in to comment.