Skip to content

Commit

Permalink
fix(ci): trigger image build on successful release (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvester-pari authored Jan 31, 2025
1 parent a5d1274 commit a43afc9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/build-image.yml

This file was deleted.

34 changes: 33 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,47 @@
name: Manage releases

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
name: release-please

env:
IMAGE_NAME: ghcr.io/eox-a/git-clerk:${{ github.head_ref || github.ref_name }}

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release Please! 🤖
uses: googleapis/release-please-action@v4
id: release
- name: Checkout 🛎️
uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ fromJSON(steps.release.outputs.releases_created) }}
- name: Set up NPM 🔧
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
if: ${{ fromJSON(steps.release.outputs.releases_created) }}
- name: Install dependencies 🔧
run: npm ci
if: ${{ fromJSON(steps.release.outputs.releases_created) }}
- name: Build package 🔧
run: npm run build --if-present
if: ${{ fromJSON(steps.release.outputs.releases_created) }}
- name: Build image 🔧
run: docker build -t $IMAGE_NAME .
if: ${{ fromJSON(steps.release.outputs.releases_created) }}
- name: Login ghcr 🔧
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
if: ${{ fromJSON(steps.release.outputs.releases_created) }}
- name: Push ghcr 🚀
run: docker push $IMAGE_NAME
if: ${{ fromJSON(steps.release.outputs.releases_created) }}

0 comments on commit a43afc9

Please sign in to comment.