-
Notifications
You must be signed in to change notification settings - Fork 90
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
github/workflows: add multi platform docker image #348
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
65afee4
push image to multiple platforms
dB2510 9d003fd
add metadata
dB2510 815fc76
push only one platform
dB2510 c03495b
push to arm64
dB2510 b11eef4
update release.yml
dB2510 07c135d
cleanup
dB2510 25c2ac6
cleanup
dB2510 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 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 |
---|---|---|
|
@@ -9,26 +9,37 @@ jobs: | |
runs-on: ubuntu-latest | ||
name: Build Docker Image | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: docker/setup-buildx-action@v1 | ||
|
||
- id: get-version | ||
run: | | ||
version=$(echo "${{ github.sha }}" | cut -c1-8) | ||
echo "::set-output name=version::$version" | ||
|
||
- name: Publish to registry | ||
uses: elgohr/[email protected] | ||
env: | ||
NODE_ENV: production | ||
DOCKER_BUILDKIT: 1 | ||
- id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/obolnetwork/charon/charon | ||
tags: "latest,${{steps.get-version.outputs.version}}" | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
name: ${{ github.repository }}/charon | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.CONTAINER_REGISTRY_SECRET }} | ||
buildargs: GITHUB_SHA=${{ github.sha }} | ||
registry: ghcr.io | ||
tags: "latest,${{steps.get-version.outputs.version}}" | ||
|
||
- name: Publish to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
build-args: GITHUB_SHA=${{ github.sha }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,23 +10,37 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- id: get-version | ||
run: | | ||
version=$(echo "${{ github.ref }}" | cut -d / -f 3) | ||
version=$(echo "${{ github.sha }}" | cut -c1-8) | ||
echo "::set-output name=version::$version" | ||
|
||
- name: Publish to registry | ||
uses: elgohr/[email protected] | ||
env: | ||
NODE_ENV: production | ||
DOCKER_BUILDKIT: 1 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
name: ${{ github.repository }}/charon | ||
images: | | ||
ghcr.io/obolnetwork/charon/charon | ||
tags: "latest,${{steps.get-version.outputs.version}}" | ||
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. only push the tag, |
||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.CONTAINER_REGISTRY_SECRET }} | ||
buildargs: GITHUB_SHA=${{ github.sha }} | ||
registry: ghcr.io | ||
tags: "${{ steps.get-version.outputs.version }}" | ||
|
||
- name: Publish to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
build-args: GITHUB_SHA=${{ github.sha }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Generate cli reference | ||
run: docker run ghcr.io/obolnetwork/charon/charon:${{steps.get-version.outputs.version}} charon run --help > cli-reference.txt | ||
|
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.
this gets a tag, not a sha. So please revert and rename to
get-tag