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

Run docker build on PR #852

Merged
merged 9 commits into from
Aug 22, 2024
Merged

Run docker build on PR #852

merged 9 commits into from
Aug 22, 2024

Conversation

dati18
Copy link
Contributor

@dati18 dati18 commented Aug 14, 2024

No description provided.

Copy link

Deployment previews on netlify for branch refs/pull/852/merge will be at the following locations (when build is done):

@m90
Copy link
Contributor

m90 commented Aug 14, 2024

Over in api we also build the image on Pull Requests, but don't push them, I guess we want the same here: https://github.com/wbstack/api/blob/184cdd4f063a9ed70ac948be8ce6c1d79e11e420/.github/workflows/docker.build.yml#L55

@dati18
Copy link
Contributor Author

dati18 commented Aug 14, 2024

@m90 please check again

@m90
Copy link
Contributor

m90 commented Aug 14, 2024

I think the additional trigger is still needed. See the action definition for API as a reference

@dati18
Copy link
Contributor Author

dati18 commented Aug 14, 2024

can you elaborate @m90 ?

@m90
Copy link
Contributor

m90 commented Aug 14, 2024

Right now, only pushes to main will trigger a build at all:

on:
  push:
    branches:
    - main

Compare this with API which has an additional pull_request trigger:

on:
  push:
    branches:
      - 'main'
    tags:
      - '*'
  pull_request:

I don't think the tags are needed for ui, but we'll definitely need the pull_request trigger that kicks off this workflow, telling us if the image builds correctly. We then skip pushing the image to the image registry using the condition in push

@m90
Copy link
Contributor

m90 commented Aug 15, 2024

While this now correctly stopped pushing the image to the image registry, we still need to prevent all of the following steps (the ones creating a pull request in the deploy repo and sending out a mattermost notification about it) from running.

This can be doing using a top-level if condition on a step:

 - name: Something that should not run for Pull Requests
   if: github.event_name != 'pull_request'
   # ...

@dati18 dati18 merged commit 47cd3f0 into main Aug 22, 2024
9 checks passed
@dati18 dati18 deleted the docker-build-pr branch August 22, 2024 14:56
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