@@ -17,11 +17,15 @@ Deploys a container image to ZAD Operations Manager.
1717| ` comment-on-pr ` | No | ` false ` | Post/update a comment on the PR with the deployment URL |
1818| ` github-token ` | No | ` github.token ` | GitHub token for PR commenting (defaults to automatic token) |
1919| ` comment-header ` | No | ` ## 🚀 Preview Deployment ` | Custom header for the PR comment |
20+ | ` wait-for-ready ` | No | ` false ` | Wait for deployment to be reachable |
21+ | ` health-endpoint ` | No | ` / ` | Endpoint to check for readiness |
22+ | ` wait-timeout ` | No | ` 300 ` | Maximum wait time in seconds |
23+ | ` wait-interval ` | No | ` 10 ` | Seconds between readiness checks |
2024
2125## Outputs
2226
23- | Name | Description |
24- | ------| -------------|
27+ | Name | Description |
28+ | ------- | -------------------- -------------|
2529| ` url ` | URL of the deployed application |
2630
2731## Example Usage
@@ -30,17 +34,13 @@ Deploys a container image to ZAD Operations Manager.
3034
3135``` yaml
3236- name : Deploy to ZAD
33- id : deploy
3437 uses : RijksICTGilde/zad-actions/deploy@v1
3538 with :
3639 api-key : ${{ secrets.ZAD_API_KEY }}
37- project-id : regel-k4c
40+ project-id : my-project
3841 deployment-name : production
39- component : editor
40- image : ghcr.io/minbzk/regelrecht-mvp:latest
41-
42- - name : Show deployment URL
43- run : echo "Deployed to ${{ steps.deploy.outputs.url }}"
42+ component : web
43+ image : ghcr.io/org/app:latest
4444` ` `
4545
4646### PR Preview with Cloned Config
@@ -51,11 +51,11 @@ Deploys a container image to ZAD Operations Manager.
5151 uses : RijksICTGilde/zad-actions/deploy@v1
5252 with :
5353 api-key : ${{ secrets.ZAD_API_KEY }}
54- project-id : regel-k4c
54+ project-id : my-project
5555 deployment-name : pr${{ github.event.pull_request.number }}
56- component : editor
57- image : ghcr.io/minbzk/regelrecht-mvp:pr- ${{ github.event.number }}
58- clone-from : production
56+ component : web
57+ image : ghcr.io/org/app: ${{ github.sha }}
58+ clone-from : development
5959` ` `
6060
6161### PR Preview with Automatic Comment
@@ -76,8 +76,8 @@ deploy-preview:
7676 project-id : my-project
7777 deployment-name : pr${{ github.event.pull_request.number }}
7878 component : web
79- image : ghcr.io/org/app:pr- ${{ github.event.number }}
80- clone-from : production
79+ image : ghcr.io/org/app:${{ github.sha }}
80+ clone-from : development
8181 comment-on-pr : true
8282` ` `
8383
@@ -87,7 +87,7 @@ The action will create a comment like this on the PR:
8787>
8888> Your changes have been deployed to a preview environment:
8989>
90- > **URL:** https://web-pr123 -my-project.rig.prd1.gn2.quattro.rijksapps.nl
90+ > **URL:** https://web-pr85 -my-project.your-domain.example.com
9191>
9292> This deployment will be automatically cleaned up when the PR is closed.
9393
@@ -110,15 +110,15 @@ deploy:
110110 project-id : my-project
111111 deployment-name : pr${{ github.event.pull_request.number }}
112112 component : web
113- image : ghcr.io/org/app:pr- ${{ github.event.number }}
113+ image : ghcr.io/org/app:${{ github.sha }}
114114` ` `
115115
116116## Permissions
117117
118- | Feature | Required Permission |
119- |---------| ---------------------|
120- | Basic deployment | None (only ZAD API key) |
121- | PR commenting | ` pull-requests: write` |
118+ | Feature | Required Permission |
119+ |------------------|------ ---------------------|
120+ | Basic deployment | None (only ZAD API key) |
121+ | PR commenting | ` pull-requests: write` |
122122
123123For PR commenting, ensure your job has the required permission (the token defaults to `github.token`) :
124124
@@ -131,12 +131,12 @@ permissions:
131131
132132The output URL follows the standard ZAD pattern :
133133` ` `
134- https://{component}-{deployment}-{project}.rig.prd1.gn2.quattro.rijksapps.nl
134+ https://{component}-{deployment}-{project}.your-domain.example.com
135135` ` `
136136
137137For example :
138- - `component : editor `, `deployment: pr73 `, `project: regel-k4c `
139- - URL : ` https://editor-pr73-regel-k4c.rig.prd1.gn2.quattro.rijksapps.nl `
138+ - `component : web `, `deployment: pr85 `, `project: my-project `
139+ - URL : ` https://web-pr85-my-project.your-domain.example.com `
140140
141141# ## Multi-Component Deployment
142142
@@ -167,8 +167,8 @@ Deploy to different environments based on branch:
167167deploy:
168168 runs-on: ubuntu-latest
169169 steps:
170- - name: Deploy to staging
171- if: github.ref == 'refs/heads/develop '
170+ - name: Deploy to preview
171+ if: github.ref == 'refs/heads/staging '
172172 uses: RijksICTGilde/zad-actions/deploy@v1
173173 with:
174174 api-key: ${{ secrets.ZAD_API_KEY }}
@@ -186,36 +186,23 @@ deploy:
186186 deployment-name: production
187187 component: web
188188 image: ghcr.io/org/app:${{ github.sha }}
189- clone-from: staging
190189` ` `
191190
192191# ## Deploy with Deployment Status Check
193192
194- Wait for deployment to be healthy :
193+ Wait for deployment to be healthy using the built-in `wait-for-ready` feature :
195194
196195` ` ` yaml
197196- name: Deploy to ZAD
198- id: deploy
199197 uses: RijksICTGilde/zad-actions/deploy@v1
200198 with:
201199 api-key: ${{ secrets.ZAD_API_KEY }}
202200 project-id: my-project
203201 deployment-name: production
204202 component: web
205203 image: ghcr.io/org/app:latest
206-
207- - name: Wait for deployment to be ready
208- run: |
209- for i in {1..30}; do
210- if curl -s -o /dev/null -w "%{http_code}" "${{ steps.deploy.outputs.url }}/health" | grep -q "200"; then
211- echo "Deployment is healthy!"
212- exit 0
213- fi
214- echo "Waiting for deployment... (attempt $i/30)"
215- sleep 10
216- done
217- echo "Deployment health check timed out"
218- exit 1
204+ wait-for-ready: true
205+ health-endpoint: /health
219206` ` `
220207
221208# # How It Works
0 commit comments