Skip to content

Commit

Permalink
Merge pull request #28 from Alirezaja1384/main
Browse files Browse the repository at this point in the history
feat(build.yaml): Update deployment step
  • Loading branch information
Alirezaja1384 authored Sep 8, 2024
2 parents f0a6ea2 + b1e14fe commit b7f30cc
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,36 @@ jobs:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}

- name: Update deployment
uses: "@actions/github-script"
with:
github-token: ${{ secrets.DEPLOYMENT_PAT }}
script: |
if(!'${{ secrets.DEPLOYMENT_PAT }}') {
console.log('No PAT provided, skipping deployment update')
return
}
const owner = '${{ secrets.DEPLOYMENT_OWNER }}'
const repo = '${{ secrets.DEPLOYMENT_REPO }}'
const workflow_id = '${{ secrets.DEPLOYMENT_WORKFLOW }}'
const ref = 'main'
const deployment_name = '${{ secrets.DEPLOYMENT_NAME }}'
const version = '${{ needs.tag.outputs.new_version }}'
if (!owner || !repo || !workflow_id || !deployment_name || !version) {
core.setFailed('Missing required inputs')
return
}
await github.actions.createWorkflowDispatch({
owner: owner,
repo: repo,
workflow_id: workflow_id,
ref: ref,
inputs: {
version: version,
deployment: deployment_name,
}
})

0 comments on commit b7f30cc

Please sign in to comment.