-
Notifications
You must be signed in to change notification settings - Fork 14.2k
feat(CI): Package docker containers to GHCR for PRs. #8588
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 all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
20990e1
cleanup(gha): Use Matrix runner w/ {self, ubuntu} for a low-risk work…
richieforeman 71d7c41
lint
richieforeman 3ffb96c
Merge branch 'main' into rf/gha-test
richieforeman 7d71ea1
mcp
richieforeman 52bfc33
mcp
richieforeman 6feefc2
Merge branch 'main' of github.com:google-gemini/gemini-cli into rf/do…
richieforeman ee84258
Add docker packaging action, have it trigger for CI/PRs
richieforeman 0ba8cb6
remove stray files
richieforeman 5986cfa
Merge branch 'main' of github.com:google-gemini/gemini-cli into rf/do…
richieforeman 4aed08d
hmm
richieforeman c244f0e
fix
richieforeman 13126bf
code review
richieforeman 0dc377a
Merge branch 'main' into rf/docker
richieforeman ef1ce53
lol
richieforeman 31900fa
Merge branch 'rf/docker' of github.com:google-gemini/gemini-cli into …
richieforeman e2db47d
add desc
richieforeman f75a309
ratchet+lint
richieforeman a3904fb
checkout action
richieforeman 16b7733
lint
richieforeman 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
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,73 @@ | ||
| name: 'Push to docker' | ||
| description: 'Builds packages and pushes a docker image to GHCR' | ||
|
|
||
| inputs: | ||
| github-actor: | ||
| description: 'Github actor' | ||
| required: true | ||
| github-secret: | ||
| description: 'Github secret' | ||
| required: true | ||
| ref-name: | ||
| description: 'Github ref name' | ||
| required: true | ||
| github-sha: | ||
| description: 'Github Commit SHA Hash' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: 'actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955' # ratchet:actions/checkout@v4 | ||
| with: | ||
| ref: '${{ inputs.github-sha }}' | ||
| fetch-depth: 0 | ||
| - name: 'Install Dependencies' | ||
| shell: 'bash' | ||
| run: 'npm install' | ||
| - name: 'Set up Docker Buildx' | ||
| uses: 'docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435' # ratchet:docker/setup-buildx-action@v3 | ||
| - name: 'build' | ||
| shell: 'bash' | ||
| run: 'npm run build' | ||
| - name: 'pack @google/gemini-cli' | ||
| shell: 'bash' | ||
| run: 'npm pack -w @google/gemini-cli --pack-destination ./packages/cli/dist' | ||
| - name: 'pack @google/gemini-cli-core' | ||
| shell: 'bash' | ||
| run: 'npm pack -w @google/gemini-cli-core --pack-destination ./packages/core/dist' | ||
| - name: 'Log in to GitHub Container Registry' | ||
| uses: 'docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1' # ratchet:docker/login-action@v3 | ||
| with: | ||
| registry: 'ghcr.io' | ||
| username: '${{ inputs.github-actor }}' | ||
| password: '${{ inputs.github-secret }}' | ||
| - name: 'Get branch name' | ||
| id: 'branch_name' | ||
| shell: 'bash' | ||
| run: | | ||
| REF_NAME="${{ inputs.ref-name }}" | ||
| echo "name=${REF_NAME%/merge}" >> $GITHUB_OUTPUT | ||
| - name: 'Build and Push the Docker Image' | ||
| uses: 'docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83' # ratchet:docker/build-push-action@v6 | ||
| with: | ||
| context: '.' | ||
| file: './Dockerfile' | ||
| push: true | ||
| provenance: false # avoid pushing 3 images to Aritfact Registry | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}/cli:${{ steps.branch_name.outputs.name }} | ||
| ghcr.io/${{ github.repository }}/cli:${{ inputs.github-sha }} | ||
| - name: 'Create issue on failure' | ||
| if: |- | ||
| ${{ failure() }} | ||
| shell: 'bash' | ||
| env: | ||
| GITHUB_TOKEN: '${{ inputs.github-secret }}' | ||
| DETAILS_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | ||
| run: |- | ||
| gh issue create \ | ||
| --title "Docker build failed" \ | ||
| --body "The docker build failed. See the full run for details: ${DETAILS_URL}" \ | ||
| --label "kind/bug,release-failure" | ||
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
Oops, something went wrong.
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.