Skip to content

Commit

Permalink
update deployed image on merge to master
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed May 7, 2024
1 parent ef3ba1a commit 457f643
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Generate Auth Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Build test image
id: docker-build-test
uses: docker/build-push-action@v5
Expand All @@ -46,5 +52,12 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
- if: contains( fromJSON(steps.meta.outputs.json).tags, "${{ github.repository }}:latest")
run: echo 'need update to ${{ fromJSON(steps.meta.outputs.json).tags[0] }}'
- name: Update deployed image
if: ${{ contains( fromJSON(steps.meta.outputs.json).tags, "${{ github.repository }}:latest") }}
uses: benc-uk/workflow-dispatch@v1
with:
repo: metacpan/metacpan-k8s
ref: main
workflow: set-image.yml
token: ${{ steps.app-token.outputs.token }}
inputs: '{ "app": "api-v0-shim", "environment": "prod", "base-tag": "${{ github.repository }}:latest", "tag": "${{ fromJSON(steps.meta.outputs.json).tags[0] }}" }'

0 comments on commit 457f643

Please sign in to comment.