-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add cloudrun deploy job #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dd9dcf7
feat: add cloudrun deploy jobs
smelchior 9666519
fix: review items
smelchior e606a4d
feat: add container flag
smelchior 6a4dad1
fix: cloudrun commands
smelchior de7e13d
fix: cloudrun commands
smelchior ab029e3
fix: cloudrun commands
smelchior 0c2369b
fix: cloudrun commands
smelchior 4887ad5
fix: cloudrun commands
smelchior 39572c8
fix: cloudrun commands
smelchior 94051b3
fix: add beta component to gcloud CLI installation
smelchior 33c8e62
fix: cloudrun commands
smelchior 64bdf69
fix: review comments
smelchior 80e6d85
chore: fix review comments
smelchior ac94dcf
Apply suggestion from @coderabbitai[bot]
smelchior 8996ff3
Merge branch 'v1' into feat/cloudrun
smelchior File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: 'Reusable gcp cloudrun deploy workflow' | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| job-name: | ||
| required: false | ||
| type: string | ||
| service-name: | ||
| required: false | ||
| type: string | ||
| registry: | ||
| required: true | ||
| type: string | ||
| artifact-repository: | ||
| required: true | ||
| type: string | ||
| artifact-tag: | ||
| required: true | ||
| type: string | ||
| region: | ||
| required: true | ||
| type: string | ||
| flags: | ||
| type: string | ||
| container: | ||
| type: string | ||
| workload-identity-provider: | ||
| required: true | ||
| type: string | ||
| workload-identity-service-account-mail: | ||
| required: true | ||
| type: string | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| jobs: | ||
| deploy_cloudrun: | ||
| name: Deployment job | ||
| permissions: | ||
| contents: 'read' | ||
| id-token: 'write' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Validate inputs | ||
| run: | | ||
| if [[ -z "${{ inputs.job-name }}" && -z "${{ inputs.service-name }}" ]]; then | ||
| echo "Error: at least one of 'job-name' or 'service-name' must be provided" | ||
|
marek-saji marked this conversation as resolved.
Outdated
marek-saji marked this conversation as resolved.
Outdated
|
||
| exit 1 | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - uses: 'google-github-actions/auth@v3' | ||
| with: | ||
| service_account: ${{ inputs.workload-identity-service-account-mail }} | ||
| workload_identity_provider: ${{ inputs.workload-identity-provider }} | ||
| - name: 'Prepare deployment flags field' | ||
| id: flags | ||
| run: | | ||
| FLAGS="${{ inputs.flags }}" | ||
| if [ -n "${{ inputs.container }}" ]; then | ||
| FLAGS="$FLAGS --container ${{ inputs.container }}" | ||
| fi | ||
| echo "flags=$FLAGS" >> "$GITHUB_OUTPUT" | ||
| - name: 'deploy cloudrun job' | ||
| if: inputs.job-name != '' | ||
| uses: 'google-github-actions/deploy-cloudrun@v3' | ||
| with: | ||
| image: ${{ inputs.registry }}/${{ inputs.artifact-repository }}:${{ inputs.artifact-tag }} | ||
| region: ${{ inputs.region }} | ||
| job: ${{ inputs.job-name }} | ||
| flags: ${{ steps.flags.outputs.flags }} | ||
| - name: 'deploy cloudrun service' | ||
| if: inputs.service-name != '' | ||
| uses: 'google-github-actions/deploy-cloudrun@v3' | ||
| with: | ||
| image: ${{ inputs.registry }}/${{ inputs.artifact-repository }}:${{ inputs.artifact-tag }} | ||
| region: ${{ inputs.region }} | ||
| service: ${{ inputs.service-name }} | ||
| flags: ${{ steps.flags.outputs.flags }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.