forked from aws-samples/bedrock-access-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
GHA for push to docker.io #17
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 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 | ||
---|---|---|---|---|
@@ -1,42 +1,33 @@ | ||||
name: Go package | ||||
|
||||
on: | ||||
push: | ||||
tags: | ||||
- "v*" # push events to tagged commits | ||||
branches: | ||||
- "**" | ||||
workflow_dispatch: | ||||
permissions: | ||||
contents: read | ||||
id-token: write # for GitHub id-token auth | ||||
|
||||
jobs: | ||||
push-docker: | ||||
if: startsWith(github.ref, 'refs/tags/v') # only run this step on tagged commits | ||||
make-images: | ||||
name: Make Docker Images and Push To Registry | ||||
if: github.ref == 'refs/heads/defang' | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is implied by the suggestion above, so it could be removed here
Suggested change
|
||||
runs-on: ubuntu-latest | ||||
steps: | ||||
- uses: actions/checkout@v4 | ||||
- name: Checkout source | ||||
uses: actions/checkout@v4 | ||||
with: | ||||
ref: defang | ||||
|
||||
- name: Set up Docker Buildx | ||||
uses: docker/setup-buildx-action@v3 | ||||
|
||||
- name: Log in to Docker Hub | ||||
uses: docker/login-action@v3 | ||||
with: | ||||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||
|
||||
- name: Set up QEMU (for multi-arch builds) | ||||
uses: docker/setup-qemu-action@v3 | ||||
|
||||
- name: Build and push Docker images and manifests | ||||
working-directory: src | ||||
run: make push-images ${{ startsWith(github.ref, 'refs/tags/v') && format('VERSION={0}', github.ref_name) || '' }} | ||||
|
||||
- name: Login to Docker Hub | ||||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||||
- name: Push Docker images | ||||
run: make push | ||||
on-failure: | ||||
runs-on: ubuntu-latest | ||||
if: failure() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | ||||
needs: [push-docker] | ||||
needs: [make-images] | ||||
steps: | ||||
- name: Slack Notification | ||||
uses: rtCamp/action-slack-notify@v2 | ||||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you make this change? I think automatically pushing to docker.io on each merge to
defang
is a good idea.Why shouldn't we do something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am reluctant to have this auto push until we have a test in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test of what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end to end test. The fact that we have to handle differences between anthropic and gemini makes me think regressions will go undetected if we automate pushing.