Skip to content

Commit 843016b

Browse files
committed
Set and use SERVER_IMAGE_URL and SERVER_IMAGE_TAG variables; add GH_TOKEN for staging deployment
1 parent acb1324 commit 843016b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/gitops-staging.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
# temp set these to true for testing
4545
echo "server=true" >> $GITHUB_OUTPUT
4646
echo "Server jobs will run."
47-
47+
4848
echo "client=true" >> $GITHUB_OUTPUT
4949
echo "Client jobs will run."
5050
@@ -207,8 +207,11 @@ jobs:
207207
steps:
208208
- name: Set image tag variables
209209
run: |
210-
echo "SERVER_IMAGE_TAG=${{ needs.build-and-deploy-server.outputs.server-image-tag }}" >> $GITHUB_ENV
211-
echo "Server image tag: ${{ needs.build-and-deploy-server.outputs.server-image-tag }}"
210+
# Set the full image URL and extract the tag
211+
echo "SERVER_IMAGE_URL=${{ needs.build-and-deploy-server.outputs.server-image-tag }}" >> $GITHUB_ENV
212+
echo "SERVER_IMAGE_TAG=$(echo "${{ needs.build-and-deploy-server.outputs.server-image-tag }}" | cut -d':' -f2)" >> $GITHUB_ENV
213+
echo "Server image URL: $SERVER_IMAGE_URL"
214+
echo "Server image tag: $SERVER_IMAGE_TAG"
212215
213216
- name: Checkout GitOps Repository
214217
if: ${{ env.SERVER_IMAGE_TAG != '' }}
@@ -250,6 +253,8 @@ jobs:
250253
251254
- name: Deploy to Staging using Terraform
252255
if: ${{ env.SERVER_IMAGE_TAG != '' }}
256+
env:
257+
GH_TOKEN: ${{ secrets.GITOPS_TOKEN }}
253258
run: |
254259
cd gitops-repo
255260

0 commit comments

Comments
 (0)