Skip to content

Commit

Permalink
ci: make release-please trigger builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseylin committed Jul 26, 2023
1 parent 45c2ce8 commit 992aa3b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ name: build-images

on:
workflow_dispatch:
release:
types: [published]
workflow_call:
inputs:
is_pull_request:
required: true
type: boolean
sem_ver:
required: false
type: string
secrets: inherit
push:
tags:
- "v*"

jobs:
docker:
build:
strategy:
matrix:
# TODO: automate the generation of this list someday
Expand All @@ -31,6 +38,8 @@ jobs:
- image: "jupyter"
context: "./services/base/JupyterLab"
runs-on: ubuntu-latest
env:
SEMVER: ${{ inputs.is_propagated_pull_request && inputs.sem_ver || ''}}
steps:
- name: Checkout repo
uses: actions/checkout@v3
Expand All @@ -41,6 +50,7 @@ jobs:
images: |
registry.gitlab.inria.fr/cromac/automateddiscoverytool/${{ matrix.image }}
tags: |
type=raw,priority=1000,value=${{ env.SEMVER }}
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
Expand All @@ -49,7 +59,7 @@ jobs:
type=semver,pattern={{major}}
type=sha,prefix=sha-
- name: Login to Gitlab registry
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && inputs.is_propagated_pull_request = false
uses: docker/login-action@v2
with:
registry: registry.gitlab.inria.fr/cromac/automateddiscoverytool
Expand All @@ -59,6 +69,6 @@ jobs:
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' && inputs.is_propagated_pull_request = false }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
on:
workflow_dispatch:
push:
branches:
- prod
- dev

permissions:
contents: write
Expand All @@ -11,11 +10,16 @@ permissions:
name: release-please

jobs:
release-please:
release-pr:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
default-branch: prod
package-name: adtool
default-branch: dev
build-docs:
needs: release-pr
uses: ./.github/workflows/build-docs.yml
build-images:
needs: release-pr
uses: ./.github/workflows/build-images.yml

0 comments on commit 992aa3b

Please sign in to comment.