-
Notifications
You must be signed in to change notification settings - Fork 79
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: fix docker tags #375
Conversation
- id: get-version | ||
run: | | ||
version=$(echo "${{ github.sha }}" | cut -c1-8) | ||
echo "::set-output name=version::$version" | ||
|
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.
no need for this, docker/metadata-action has support to configure tags
.github/workflows/build.yml
Outdated
images: ghcr.io/obolnetwork/charon/charon | ||
tags: | | ||
# Tag "git short sha" on push to branch (main) | ||
type=sha,event=branch,format=short |
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.
can ommit format
since it is short by default short
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.
done
.github/workflows/build.yml
Outdated
type=sha,event=branch,format=short | ||
|
||
# Tag "latest" on push to branch (main) | ||
type=raw,event=branch,value=latest |
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.
we don't need this as line: 29 handle latest tag by default.
ref: https://github.com/docker/metadata-action#latest-tag
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.
clarified!
push: true | ||
build-args: GITHUB_SHA=${{ github.sha }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- run: docker run ghcr.io/obolnetwork/charon/charon:${{steps.get-tag.outputs.tag}} charon run --help > cli-reference.txt |
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.
update this too since, there is no get-tag step.
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.
removed it
username: ${{ github.actor }} | ||
password: ${{ secrets.CONTAINER_REGISTRY_SECRET }} | ||
|
||
- uses: docker/build-push-action@v2 |
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.
we will not push at the time of release then?
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.
we still do
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 PR adds tags: ['v*']
to build.yml which triggers it on release
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.
LGTM
Fixes "build" github action to:
category: bug
ticket: #339