Skip to content

Commit

Permalink
ci: refactor ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseylin committed Jul 26, 2023
1 parent 9a9576b commit a485e92
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 52 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: build-docs
name: Build and deploy documentation
on:
workflow_call:
push:
branches:
- prod
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: build-images
name: Build container images

on:
workflow_dispatch:
pull_request:
workflow_call:
inputs:
push-images:
Expand All @@ -15,9 +15,6 @@ on:
required: true
GITLAB_REGISTRY_PASSWORD:
required: true
push:
tags:
- "v*"

jobs:
build:
Expand All @@ -43,7 +40,7 @@ jobs:
context: "./services/base/JupyterLab"
runs-on: ubuntu-latest
env:
SEMVER: ${{ inputs.is_propagated_pull_request && inputs.sem-ver || ''}}
SEMVER: ${{ inputs.push-images && inputs.sem-ver || ''}}
steps:
- name: Checkout repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -73,6 +70,6 @@ jobs:
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
push: ${{ inputs.push_images }}
push: ${{ inputs.push-images }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
36 changes: 0 additions & 36 deletions .github/workflows/build.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: format code

on:
push:
branches:
- dev
pull_request:

jobs:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ permissions:
contents: write
pull-requests: write

name: release-please
name: Release pipeline based on detection of Conventional Commits

jobs:
release-pr:
release-please:
runs-on: ubuntu-latest
steps:
- id: release-please
- name: Check for new semver release
id: release-pr
uses: google-github-actions/release-please-action@v3
with:
pull-request-title-pattern: "chore${scope}: release${component} ${version}"
release-type: simple
default-branch: dev
outputs:
releases_created: ${{ steps.release-pr.outputs.releases_created }}
sem-ver: ${{ steps.release-pr.outputs.major }}.${{ steps.release-pr.outputs.minor }}.${{ steps.release-pr.outputs.patch }}
build-and-deploy:
needs: release-please
if: jobs.release-please.outputs.releases_created
uses: ./.github/workflows/build-images.yml
with:
push-images: true
sem-ver: ${{ jobs.release-please.outputs.sem-ver }}

0 comments on commit a485e92

Please sign in to comment.