fix: specify required permission for interface deploy step #2
This file contains 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: Release workflow | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit: | ||
description: "Leave blank to use current HEAD, or provide an override commit SHA" | ||
type: string | ||
required: false | ||
jobs: | ||
ref: | ||
name: Load Commit Ref | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: ref | ||
uses: passportxyz/gh-workflows/.github/actions/load_commit_ref@main | ||
with: | ||
commit: ${{ inputs.commit }} | ||
outputs: | ||
version_tag: ${{ steps.ref.outputs.version_tag }} | ||
docker_tag: ${{ steps.ref.outputs.docker_tag }} | ||
refspec: ${{ steps.ref.outputs.refspec }} | ||
test: | ||
name: Test | ||
uses: ./.github/workflows/test_generic.yml | ||
with: | ||
commit: ${{ inputs.commit }} | ||
environment: review | ||
secrets: inherit | ||
create-draft-release: | ||
name: Create Draft Release | ||
runs-on: ubuntu-latest | ||
needs: [ref, test] | ||
permissions: write-all | ||
steps: | ||
- name: Release | ||
# https://github.com/ncipollo/release-action | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
generateReleaseNotes: true | ||
allowUpdates: true | ||
token: ${{ secrets.github_token }} | ||
tag: ${{ needs.ref.outputs.version_tag }} | ||
commit: ${{ needs.ref.outputs.refspec }} | ||
draft: true | ||
deploy-staging: | ||
name: Deploy to Staging | ||
needs: [create-draft-release] | ||
uses: ./.github/workflows/build_and_deploy_generic.yml | ||
with: | ||
commit: ${{ inputs.commit }} | ||
environment: staging | ||
secrets: inherit | ||
deploy-interface-to-staging: | ||
name: Push code to branch | ||
needs: [create-draft-release] | ||
uses: passportxyz/gh-workflows/.github/actions/push_to_branch@main | ||
Check failure on line 63 in .github/workflows/release_and_deploy_production.yml GitHub Actions / .github/workflows/release_and_deploy_production.ymlInvalid workflow file
|
||
with: | ||
commit: ${{ needs.ref.outputs.refspec }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: staging-interface | ||
deploy-production: | ||
name: Deploy to Production | ||
needs: [deploy-staging, deploy-interface-to-staging] | ||
uses: ./.github/workflows/build_and_deploy_generic.yml | ||
with: | ||
commit: ${{ inputs.commit }} | ||
environment: production | ||
secrets: inherit | ||
deploy-interface-to-production: | ||
name: Push code to branch | ||
needs: [deploy-staging, deploy-interface-to-staging] | ||
uses: passportxyz/gh-workflows/.github/actions/push_to_branch@main | ||
with: | ||
commit: ${{ needs.ref.outputs.refspec }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: staging-interface | ||
release: | ||
name: Release | ||
needs: [ref, create-draft-release, deploy-production] | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Release | ||
# https://github.com/ncipollo/release-action | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
omitBodyDuringUpdate: true | ||
token: ${{ secrets.github_token }} | ||
tag: ${{ needs.ref.outputs.version_tag }} | ||
commit: ${{ needs.ref.outputs.refspec }} | ||
draft: false |