Skip to content

Commit

Permalink
Format with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ncalteen committed Sep 6, 2023
1 parent e26bc96 commit 652d3b2
Showing 1 changed file with 41 additions and 46 deletions.
87 changes: 41 additions & 46 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ jobs:
if: ${{ github.event.issue.pull_request }} # only run on pull request comments

steps:

# The branch-deploy Action
# The branch-deploy Action
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@vX.X.X

# If the branch-deploy Action was triggered, checkout our branch
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -83,7 +82,7 @@ name: branch-deploy
on:
issue_comment:
types: [ created ]
types: [created]
# The working directory where our Terraform files are located
env:
Expand All @@ -93,7 +92,7 @@ env:
permissions:
pull-requests: write
deployments: write
contents: write
contents: write
checks: read
jobs:
Expand All @@ -107,8 +106,7 @@ jobs:
working-directory: ${{ env.WORKING_DIR }} # the directory we use where all our TF files are stored
steps:
# The branch-deploy Action
# The branch-deploy Action
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@vX.X.X
Expand Down Expand Up @@ -189,7 +187,7 @@ name: branch-deploy
on:
issue_comment:
types: [ created ]
types: [created]
permissions:
pull-requests: write
Expand All @@ -205,8 +203,7 @@ jobs:
environment: production-secrets # the locked down environment we pull secrets from
steps:
# The branch-deploy Action
# The branch-deploy Action
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@vX.X.X
Expand Down Expand Up @@ -242,7 +239,7 @@ name: branch-deploy
on:
issue_comment:
types: [ created ]
types: [created]
permissions:
pull-requests: write
Expand All @@ -258,8 +255,7 @@ jobs:
environment: production-secrets # the locked down environment we pull secrets from
steps:
# The branch-deploy Action
# The branch-deploy Action
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@vX.X.X
Expand Down Expand Up @@ -305,7 +301,7 @@ on:
permissions:
pull-requests: write
deployments: write
contents: write
contents: write
checks: read
jobs:
Expand All @@ -315,8 +311,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# The branch-deploy Action
# The branch-deploy Action
- uses: github/branch-deploy@vX.X.X
id: branch-deploy
Expand Down Expand Up @@ -354,7 +349,7 @@ name: branch-deploy
on:
issue_comment:
types: [ created ]
types: [created]
# Permissions needed for reacting and adding comments for IssueOps commands
permissions:
Expand All @@ -370,8 +365,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# The branch-deploy Action
# The branch-deploy Action
- uses: github/branch-deploy@vX.X.X
id: branch-deploy
Expand Down Expand Up @@ -427,7 +421,7 @@ name: branch-deploy
on:
issue_comment:
types: [ created ]
types: [created]
# Permissions needed for reacting and adding comments for IssueOps commands
permissions:
Expand All @@ -443,8 +437,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# The branch-deploy Action
# The branch-deploy Action
- uses: github/branch-deploy@vX.X.X
id: branch-deploy
Expand All @@ -469,7 +462,7 @@ jobs:
uses: cloudflare/wrangler-action@3424d15af26edad39d5276be3cc0cc9ffec22b55 # pin@1.3.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: "development" # here we use development
environment: 'development' # here we use development
# If '.deploy' was used, branch deploy to the production environment
- name: Publish - Production
Expand Down Expand Up @@ -603,7 +596,7 @@ jobs:
uses: GrantBirki/comment@1e9986de26cf23e6c4350276234c91705c540fef # pin@v2.0.3
with:
comment-id: ${{ needs.trigger.outputs.comment_id }}
reactions: "-1"
reactions: '-1'
# if the deployment was successful, add a 'success' comment
- name: success comment
Expand Down Expand Up @@ -640,7 +633,7 @@ name: branch deploy
# The workflow to execute on is comments that are newly created
on:
issue_comment:
types: [ created ]
types: [created]

# Permissions needed for reacting and adding comments for IssueOps commands
permissions:
Expand Down Expand Up @@ -680,11 +673,11 @@ jobs:
- uses: github/branch-deploy@vX.X.X
id: branch-deploy
with:
trigger: ".deploy"
environment: "github-pages"
production_environment: "github-pages"
skip_completing: "true" # we will complete the deployment manually in the 'result' job
admins: "false" # <--- add your GitHub username here (if you want to use the admins feature)
trigger: '.deploy'
environment: 'github-pages'
production_environment: 'github-pages'
skip_completing: 'true' # we will complete the deployment manually in the 'result' job
admins: 'false' # <--- add your GitHub username here (if you want to use the admins feature)

# build the github-pages site with hugo
build:
Expand Down Expand Up @@ -737,7 +730,7 @@ jobs:

# deploy to GitHub Pages
deploy:
needs: [ trigger, build ]
needs: [trigger, build]
if: ${{ needs.trigger.outputs.continue == 'true' }} # only run if the trigger job set continue to true
environment:
name: github-pages
Expand All @@ -752,7 +745,7 @@ jobs:

# update the deployment result - manually complete the deployment that was created by the branch-deploy action
result:
needs: [ trigger, build, deploy ]
needs: [trigger, build, deploy]
runs-on: ubuntu-latest
# run even on failures but only if the trigger job set continue to true
if: ${{ always() && needs.trigger.outputs.continue == 'true' }}
Expand All @@ -761,7 +754,8 @@ jobs:
# if a previous step failed, set a variable to use as the deployment status
- name: set deployment status
id: deploy-status
if: ${{ needs.trigger.result == 'failure' || needs.build.result == 'failure' ||
if:
${{ needs.trigger.result == 'failure' || needs.build.result == 'failure' ||
needs.deploy.result == 'failure' }}
run: |
echo "DEPLOY_STATUS=failure" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -818,7 +812,7 @@ jobs:
uses: GrantBirki/comment@1e9986de26cf23e6c4350276234c91705c540fef # pin@v2.0.3
with:
comment-id: ${{ needs.trigger.outputs.comment_id }}
reactions: "-1"
reactions: '-1'

# if the deployment was successful, add a 'success' comment
- name: success comment
Expand Down Expand Up @@ -857,7 +851,7 @@ name: branch deploy
# The workflow to execute on is comments that are newly created
on:
issue_comment:
types: [ created ]
types: [created]

# Permissions needed for reacting and adding comments for IssueOps commands
permissions:
Expand Down Expand Up @@ -897,12 +891,12 @@ jobs:
- uses: github/branch-deploy@vX.X.X
id: branch-deploy
with:
trigger: ".deploy"
environment: "github-pages"
production_environment: "github-pages"
environment_targets: "github-pages"
skip_completing: "true" # we will complete the deployment manually in the 'result' job
admins: "false" # <--- add your GitHub username here (if you want to use the admins feature)
trigger: '.deploy'
environment: 'github-pages'
production_environment: 'github-pages'
environment_targets: 'github-pages'
skip_completing: 'true' # we will complete the deployment manually in the 'result' job
admins: 'false' # <--- add your GitHub username here (if you want to use the admins feature)

# build the github-pages site with hugo
build:
Expand All @@ -921,7 +915,7 @@ jobs:

# deploy to GitHub Pages
deploy:
needs: [ trigger, build ]
needs: [trigger, build]
if: ${{ needs.trigger.outputs.continue == 'true' }} # only run if the trigger job set continue to true
environment:
name: github-pages
Expand All @@ -936,7 +930,7 @@ jobs:

# update the deployment result - manually complete the deployment that was created by the branch-deploy action
result:
needs: [ trigger, build, deploy ]
needs: [trigger, build, deploy]
runs-on: ubuntu-latest
# run even on failures but only if the trigger job set continue to true
if: ${{ always() && needs.trigger.outputs.continue == 'true' }}
Expand All @@ -945,7 +939,8 @@ jobs:
# if a previous step failed, set a variable to use as the deployment status
- name: set deployment status
id: deploy-status
if: ${{ needs.trigger.result == 'failure' || needs.build.result == 'failure' ||
if:
${{ needs.trigger.result == 'failure' || needs.build.result == 'failure' ||
needs.deploy.result == 'failure' }}
run: |
echo "DEPLOY_STATUS=failure" >> $GITHUB_OUTPUT
Expand All @@ -966,7 +961,7 @@ jobs:
repos/{owner}/{repo}/deployments/${{ needs.trigger.outputs.deployment_id }}/statuses \
-f environment='${{ needs.trigger.outputs.environment }}' \
-f state=${DEPLOY_STATUS}
# use the GitHub CLI to remove the non-sticky lock that was created by the branch-deploy action
- name: Remove a non-sticky lock
env:
Expand Down Expand Up @@ -1002,7 +997,7 @@ jobs:
uses: GrantBirki/comment@1e9986de26cf23e6c4350276234c91705c540fef # pin@v2.0.3
with:
comment-id: ${{ needs.trigger.outputs.comment_id }}
reactions: "-1"
reactions: '-1'

# if the deployment was successful, add a 'success' comment
- name: success comment
Expand Down

0 comments on commit 652d3b2

Please sign in to comment.