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

GitHub Action that builds and publishes to GitHub Container Registry #22

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

machikoyasuda
Copy link
Member

@machikoyasuda machikoyasuda commented Oct 5, 2021

closes #7

part of cal-itp/benefits#127

What this PR does

  • Create a new GitHub action called Build and publish Docker image

What this GitHub Action does:

  • What: The action builds and publishes the eligibility-server Docker image to the GitHub Container Registry, with specific tags
  • When:
  1. After pushes to main - the main package is built and updated
  2. After a release of main, with a $version-tag-name - the package is built and published with 2 tags: the $version-tag-name, as well as latest
  • When: The action filters for pushes to main that touch actual app files (like eligibility_server/app.py or requirements.txt)

How I tested this PR

  • I forked this repository, added this GitHub Action workflow file and tried running these scenarios:
  1. Merge a PR to main that only edits the README.md: Should not trigger the build and publish workflow
  2. Merge a PR to main that edits a relevant app file: Should trigger a build and publish workflow. A package with the tag test should be published: https://github.com/machikoyasuda/eligibility-server/pkgs/container/eligibility-server/8504005?tag=test
  3. Create a release: Should trigger a build and publish workflow. A package with the tag with the release name should be published: https://github.com/machikoyasuda/eligibility-server/pkgs/container/eligibility-server

image

… the server Docker image to the GitHub container registry on pushes - both regular pushes and releases - to main
@machikoyasuda machikoyasuda marked this pull request as ready for review October 5, 2021 22:48
@machikoyasuda machikoyasuda changed the title WIP - GitHub action that builds and publishes to GitHub Container Registry GitHub action that builds and publishes to GitHub Container Registry Oct 5, 2021
@machikoyasuda machikoyasuda changed the title GitHub action that builds and publishes to GitHub Container Registry GitHub Action that builds and publishes to GitHub Container Registry Oct 5, 2021
@thekaveman thekaveman added this to In progress in Benefits 2021 via automation Oct 5, 2021
@thekaveman thekaveman added this to the October 2021 milestone Oct 6, 2021
@thekaveman thekaveman moved this from In progress to Review in progress in Benefits 2021 Oct 6, 2021
@thekaveman thekaveman removed this from Review in progress in Benefits 2021 Oct 6, 2021
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

Really great start! I requested some changes that will help us read logs and use the action checks in other contexts later if needed. Made a few other suggestions elsewhere.

.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
.github/workflows/docker-publish.yml Outdated Show resolved Hide resolved
@machikoyasuda
Copy link
Member Author

machikoyasuda commented Oct 6, 2021

Rested this Action in a fork: https://github.com/machikoyasuda/eligibility-server/pull/8

The steps I took:

  1. Merge the PR https://github.com/machikoyasuda/eligibility-server/pull/8
  2. After which, the main package was updated with this new code
  3. After that, I manually created a release called wednesday release and tagged with v0.4

https://github.com/machikoyasuda/eligibility-server/pkgs/container/eligibility-server
image

Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

🚢

@machikoyasuda machikoyasuda merged commit b788fd1 into main Oct 6, 2021
@machikoyasuda machikoyasuda deleted the feat/docker-image-publish branch October 6, 2021 21:39
@angela-tran angela-tran mentioned this pull request Nov 14, 2022
10 tasks
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.

Add GitHub Action to build/publish Docker image
2 participants