use different workflow dispatch action #124
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build production container | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-22.04 | |
name: Docker Push | |
steps: | |
- name: Generate Auth Token | |
id: auth-token | |
uses: jamestrousdale/github-app-jwt-token@0.1.4 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.auth-token.outputs.access-token }} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Build test image | |
uses: docker/build-push-action@v5 | |
with: | |
tags: metacpan/metacpan-web:test | |
target: test | |
push: false | |
- name: Run Perl tests | |
run: docker run -i metacpan/metacpan-web:test | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: metacpan/metacpan-web:latest,metacpan/metacpan-web:${{ github.sha }} | |
- name: Update deployed image | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
repo: metacpan/metacpan-k8s | |
workflow: set-image.yml | |
token: ${{ steps.auth-token.outputs.access-token }} | |
inputs: '{ "app": "web", "environment": "prod", "repository": "metacpan/metacpan-web", "tag": "${{ github.sha }}" }' |