implement auto merging dependabot PR (#75) #48
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
# mainブランチ以外へのPush時に走る処理 | |
name: push | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
# 最初にworkflowファイル全体をチェックする | |
check-workflows: | |
permissions: | |
contents: read | |
uses: ./.github/workflows/check-workflows.yml | |
# その後、デプロイする | |
# ただし、コミットメッセージに[No Deploy]が含まれている場合や | |
# dependabotが作成したPull Requestをマージしたときはデプロイしない | |
# ただしこのワークフローの実行にはGitHubリポジトリとAWS環境のOpen ID Connect等による接続が確立している必要がある | |
deploy: | |
needs: check-workflows | |
if: ${{ !contains(github.event.head_commit.message, '[No Deploy]') && !contains(toJson(github.event.commits.*.author.name), 'dependabot') }} | |
#dependabotの実験のため、一時的にデプロイを無効 | |
#permissions: | |
# id-token: write | |
# contents: read | |
#secrets: inherit | |
#uses: ./.github/workflows/deploy.yml | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo hello | |
# サーバアプリケーションのビルドする | |
build-server-app: | |
needs: check-workflows | |
permissions: | |
contents: read | |
uses: ./.github/workflows/server-app.yml | |
with: | |
run_tests: false |