Skip to content

Commit 4dbc20d

Browse files
committed
deploy once both web-server and api images are built and pushed
1 parent 3a63d75 commit 4dbc20d

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

.github/workflows/cd.deploy.stg.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
node-version: "20"
1414
os: "ubuntu-latest"
1515

16-
deploy-api:
16+
docker-build-push-api:
1717
needs: build
1818
runs-on: ubuntu-latest
1919
env:
@@ -49,18 +49,18 @@ jobs:
4949
5050
- name: Build docker image
5151
run: |
52-
docker buildx build -f api.Dockerfile . -t ghcr.io/api-dot-stage-dot-dzcode-dot-io-server:latest:latest
52+
docker buildx build -f api.Dockerfile . -t ghcr.io/dzcode-io/api-dot-stage-dot-dzcode-dot-io-server:latest:latest
5353
env:
5454
DOCKER_BUILDKIT: 1
5555

5656
- name: Push docker image
5757
run: |
5858
echo $CR_PAT | docker login ghcr.io -u dzcode-io --password-stdin
59-
docker push ghcr.io/api-dot-stage-dot-dzcode-dot-io-server:latest:latest
59+
docker push ghcr.io/dzcode-io/api-dot-stage-dot-dzcode-dot-io-server:latest:latest
6060
env:
6161
CR_PAT: ${{ secrets.CR_PAT }}
6262

63-
deploy-web-server:
63+
docker-build-push-web-server:
6464
needs: build
6565
runs-on: ubuntu-latest
6666
env:
@@ -113,12 +113,24 @@ jobs:
113113
env:
114114
CR_PAT: ${{ secrets.CR_PAT }}
115115

116-
# - name: install zcluster
117-
# run: |
118-
# curl -fsSL https://infra.zak-man.com/install.sh | sh
119-
# echo "/home/runner/.zcluster/bin" >> $GITHUB_PATH
116+
deploy-to-zcluster:
117+
needs: [docker-build-push-api, docker-build-push-web-server]
118+
runs-on: ubuntu-latest
119+
env:
120+
CI: true
121+
122+
steps:
123+
- name: "Git"
124+
uses: actions/checkout@v4
120125

121-
# - name: Deploy to zcluster
122-
# run: zcluster deploy -p stage-dzcode ./docker-compose.stage.yml
123-
# env:
124-
# ADMIN_AUTH_TOKEN: ${{ secrets.ADMIN_AUTH_TOKEN }}
126+
- name: install zcluster
127+
run: |
128+
curl -fsSL https://infra.zak-man.com/install.sh | sh
129+
echo "/home/runner/.zcluster/bin" >> $GITHUB_PATH
130+
131+
- name: Deploy to zcluster
132+
run: zcluster deploy -p stage-dzcode ./docker-compose.stage.yml
133+
env:
134+
ADMIN_AUTH_TOKEN: ${{ secrets.ADMIN_AUTH_TOKEN }}
135+
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
136+
GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)