Skip to content
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

Adding kb-sdk image build and upload to Dockerhub to GitHub actions #354

Merged
merged 1 commit into from
Sep 12, 2020

Conversation

ialarmedalien
Copy link
Collaborator

@ialarmedalien ialarmedalien commented Sep 10, 2020

for the data upload project ticket DATAUP-88

This adds an automated build and push to Dockerhub (if the appropriate auth credentials are supplied in the repo settings) when merges are made into the master and develop branches. The dockerhub images will be tagged with master and develop respectively.

The DockerHub auth hasn't been added to this repo, but here's an image I uploaded to my own dockerhub workspace using the same workflow:

https://hub.docker.com/layers/ialarmedalien/kb-sdk/autobuild_docker_images/images/sha256-8ab997902b5e81c49f0ee9bade1f278cfbb2446191da2b658cd8a303d48305b6?context=repo

@jsfillman
Copy link
Contributor

One minor suggestion I'd make is to set the branch triggers directly vs. in a conditional.
Using a conditional will cause the workflow to always be triggered, but skip steps based on the condition. Setting branches will cause the whole workflow to be skipped.

In the following example, the workflow will only trigger on PRs to develop or master, and only when the PR is created, switched from a draft review, or when it receives new commits.

---
name: Build Image
'on':
  pull_request:
    branches:
    - master
   - develop
    types:
    - opened
    - synchronize
    - ready_for_review

Feel free to steal from the narrative(-traefiker) workflow:
https://github.com/kbase/narrative-traefiker/blob/master/.github/workflows/build_prodrc_pr.yaml

@ialarmedalien
Copy link
Collaborator Author

I'm using the conditional because the other workflow steps in the file run on every pull request and push to any branch; the build/dockerhub step only needs to run when there's a merge to develop or master.

Copy link
Contributor

@jayrbolton jayrbolton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdk is released so rarely (like once every 18 months?) that i think automating the deployment isn't very important, but it is nice to standardize the github workflow alongisde our other repos.

@ialarmedalien ialarmedalien force-pushed the autobuild_docker_images branch from 19d67e1 to aa68c4d Compare September 12, 2020 00:53
@ialarmedalien ialarmedalien force-pushed the autobuild_docker_images branch from aa68c4d to b7b7d16 Compare September 12, 2020 01:01
@ialarmedalien ialarmedalien merged commit ebfcf73 into develop Sep 12, 2020
@ialarmedalien ialarmedalien deleted the autobuild_docker_images branch September 12, 2020 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants