File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 43
43
push : true
44
44
tags : ${{ steps.meta.outputs.tags }}
45
45
labels : ${{ steps.meta.outputs.labels }}
46
+ deploy :
47
+ runs-on : ubuntu-22.04
48
+ if : ${{ github.ref_type != 'tag' }}
49
+ needs :
50
+ - package
51
+ env :
52
+ RUN_REPOSITORY_NAME : " polyflix/infrastructure"
53
+ WORKFLOW_ID : 45367438
54
+ GH_TOKEN : ${{ secrets.DEPLOY_GITHUB_TOKEN }}
55
+ steps :
56
+ - uses : actions/checkout@v3
57
+ - name : trigger infrastructure workflow
58
+ run : |
59
+ export SHA_SHORT=`git rev-parse --short HEAD`
60
+ export SHA_SHORT="sha-${SHA_SHORT}"
61
+ # Fetch the repository name (e.g video)
62
+ export REPO_NAME=`gh repo view --json name | jq .name -r`
63
+
64
+ echo "Image tag: ${SHA_SHORT}"
65
+ echo "Repository name: ${REPO_NAME}"
66
+
67
+ # Run the workflow to deploy the current version
68
+ # We don't use `gh workflow` command because fine-grained PAT is not yet
69
+ # available for this command, so we need to call directly the API
70
+ gh api /repos/${RUN_REPOSITORY_NAME}/actions/workflows/${WORKFLOW_ID}/dispatches \
71
+ -X POST \
72
+ -F "inputs[environment]=qa" \
73
+ -F "inputs[service]='${REPO_NAME}'" \
74
+ -F "inputs[options]='--set image.tag=${SHA_SHORT}'" \
75
+ -F ref=main
76
+
You can’t perform that action at this time.
0 commit comments