Skip to content

Commit 25684fd

Browse files
committed
update deployed image on merge to master
1 parent ef3ba1a commit 25684fd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/build-container.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
with:
2121
username: ${{ secrets.DOCKER_HUB_USER }}
2222
password: ${{ secrets.DOCKER_HUB_TOKEN }}
23+
- name: Generate Auth Token
24+
uses: actions/create-github-app-token@v1
25+
id: app-token
26+
with:
27+
app-id: ${{ secrets.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
2329
- name: Build test image
2430
id: docker-build-test
2531
uses: docker/build-push-action@v5
@@ -46,5 +52,12 @@ jobs:
4652
push: true
4753
tags: ${{ steps.meta.outputs.tags }}
4854
annotations: ${{ steps.meta.outputs.annotations }}
49-
- if: contains( fromJSON(steps.meta.outputs.json).tags, "${{ github.repository }}:latest")
50-
run: echo 'need update to ${{ fromJSON(steps.meta.outputs.json).tags[0] }}'
55+
- name: Update deployed image
56+
if: contains( fromJSON(steps.meta.outputs.json).tags, "${{ github.repository }}:latest")
57+
uses: benc-uk/workflow-dispatch@v1
58+
with:
59+
repo: metacpan/metacpan-k8s
60+
ref: main
61+
workflow: set-image.yml
62+
token: ${{ steps.app-token.outputs.token }}
63+
inputs: '{ "app": "api-v0-shim", "environment": "prod", "base-tag": "${{ github.repository }}:latest", "tag": "${{ fromJSON(steps.meta.outputs.json).tags[0] }}" }'

0 commit comments

Comments
 (0)