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

ci: use docker/build-push-action #6425

Merged
merged 4 commits into from
Sep 6, 2023

Conversation

watarukura
Copy link
Contributor

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Related Tickets & Documents

https://discord.com/channels/1029619790563790848/1029619790563790851/1148007830805282958

sid (gh:guidopetri) — 2023/09/04 06:33
@justinclift i think we can simplify the .ci/docker_build file away. there's a build-and-push github action that we can use, e.g. https://github.com/stringer-rss/stringer/blob/main/.github/workflows/build.yml#L44-L56 , which can a) run conditionally on branches b) build across platforms and c) use caching automatically, which will improve our build times dramatically. i'd also be surprised if we couldn't set it to only build / push if the docker secrets are available
(i wrote that CI yaml recently, but i'm not super familiar with gh actions)

sid's idea is very good, I want to new preview docker image.

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

@watarukura
Copy link
Contributor Author

lint check by https://github.com/rhysd/actionlint

pwd
/Users/watarukura/src/github.com/watarukura/redash/.github/workflows
❯ actionlint -verbose ci.yml
verbose: Linting ci.yml
verbose: Using project at /Users/watarukura/src/github.com/watarukura/redash
verbose: Found 0 parse errors in 0 ms for ci.yml
verbose: Found total 0 errors in 717 ms for ci.yml

@justinclift justinclift changed the title ci: 🎡 use docker/build-push-action ci: use docker/build-push-action Sep 6, 2023
@justinclift
Copy link
Member

Thanks, that looks like the right kind of thing. 😄

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #6425 (1add20f) into master (c2e7df0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #6425   +/-   ##
=======================================
  Coverage   60.94%   60.94%           
=======================================
  Files         156      156           
  Lines       12758    12758           
  Branches     1735     1735           
=======================================
  Hits         7775     7775           
  Misses       4752     4752           
  Partials      231      231           

@justinclift
Copy link
Member

justinclift commented Sep 6, 2023

Ahhh. This looks like it's failing when the DOCKER_USER or DOCKER_PASS variables aren't set. Is there any way to have this skip the build action without causing a failure, when they're not set?

Asking because it's kind of important. Anyone that forks this repo isn't going to have those set in their repository, so their CI will immediately start throwing errors if we don't somehow work around the problem. 😄

@watarukura
Copy link
Contributor Author

OK, please wait...

@justinclift
Copy link
Member

justinclift commented Sep 6, 2023

The concept seems ok, but it looks like you need some quote characters added (or similar). 😄

@justinclift
Copy link
Member

k, this looks good. We can't test things out completely until @arikfr adds the login credentials to our GitHub settings, but that can come later on.

Thanks for getting this done @watarukura. 😄

@justinclift justinclift merged commit 9b18e18 into getredash:master Sep 6, 2023
14 checks passed
@watarukura
Copy link
Contributor Author

@justinclift Thanks for great help!

@watarukura watarukura deleted the ci/build-push-action branch September 6, 2023 08:09
justinclift referenced this pull request Sep 6, 2023
This needs the appropriate Docker Hub login credentials set in our GitHub settings before it will work properly.

  * DOCKER_USER environment variable
  * DOCKER_PASS secret
@guidopetri
Copy link
Contributor

This is awesome, thanks so much @watarukura !

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