-
Notifications
You must be signed in to change notification settings - Fork 8
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
OZ-502: GA workflows to use shared workflow to allow image releases. #13
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,52 +2,18 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
if: github.ref == 'refs/heads/main' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: mekomsolutions | ||
password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }} | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
|
||
with: | ||
images: | | ||
mekomsolutions/senaite | ||
tags: | | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=pep440,pattern={{version}} | ||
type=pep440,pattern={{major}}.{{minor}} | ||
type=sha | ||
- | ||
name: Get commit id | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
env: | ||
SERVICE: senaite | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
docker-release: | ||
uses: mekomsolutions/shared-github-workflow/.github/workflows/docker-build-publish.yml@main | ||
with: | ||
download-artifacts: false | ||
image-name: "senaite" | ||
secrets: | ||
DOCKER_HUB_USERNAME: mekomsolutions | ||
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. Let's use username from secrets here. 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. I am not sure we have one. We will need @rbuisson to confirm 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. |
||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }} |
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.
Remove on
pull_request
. We don't want to build and publish docker images on PR