Skip to content

Commit 1dd8a79

Browse files
committed
update api deployment job in stage cd action
1 parent ba7d766 commit 1dd8a79

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

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

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
env:
2020
CI: true
2121
STAGE: staging
22-
SSH_ADDRESS_STG: ${{ secrets.SSH_ADDRESS_STG }}
2322
DEPLOY_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('stg-0.0.0-{0}-{1}-{2}', github.ref_name, github.run_number, github.run_attempt) }}
2423

2524
steps:
@@ -35,18 +34,31 @@ jobs:
3534
uses: actions/download-artifact@v4
3635
with:
3736
name: build output (ubuntu-latest, 20)
38-
- name: "SSH"
39-
uses: shimataro/ssh-key-action@v2
40-
with:
41-
key: ${{ secrets.SSH_KEY }}
42-
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
37+
4338
- name: "Generate Bundle info"
4439
run: npm run generate:bundle-info $DEPLOY_VERSION stage
40+
4541
- name: "Sentry Release"
4642
# todo-zm: remove sentry entirely
4743
run: cd ./api && npm run generate:sentry-release $DEPLOY_VERSION stage ${{ secrets.SENTRY_AUTH_TOKEN }}
48-
- name: "Deploy"
49-
run: cd ./api && npm run deploy:stg
44+
45+
- name: "Write ./api deps into Dockerfile..."
46+
run: |
47+
cd ./api
48+
npm run prepare-dockerfile
49+
50+
- name: Build docker image
51+
run: |
52+
docker buildx build -f api.Dockerfile . -t ghcr.io/api-dot-stage-dot-dzcode-dot-io-server:latest:latest
53+
env:
54+
DOCKER_BUILDKIT: 1
55+
56+
- name: Push docker image
57+
run: |
58+
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
60+
env:
61+
CR_PAT: ${{ secrets.CR_PAT }}
5062

5163
deploy-web-server:
5264
needs: build
@@ -101,12 +113,12 @@ jobs:
101113
env:
102114
CR_PAT: ${{ secrets.CR_PAT }}
103115

104-
- name: install zcluster
105-
run: |
106-
curl -fsSL https://infra.zak-man.com/install.sh | sh
107-
echo "/home/runner/.zcluster/bin" >> $GITHUB_PATH
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
108120

109-
- name: Deploy to zcluster
110-
run: zcluster deploy -p stage-dzcode ./docker-compose.stage.yml
111-
env:
112-
ADMIN_AUTH_TOKEN: ${{ secrets.ADMIN_AUTH_TOKEN }}
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 }}

0 commit comments

Comments
 (0)