-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): trigger image build on successful release (#73)
- Loading branch information
1 parent
a5d1274
commit a43afc9
Showing
2 changed files
with
33 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) }} |