Skip to content

Commit

Permalink
Cleanup and separate node & docker jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePetzer-ixo committed Feb 7, 2024
1 parent a403170 commit 4dff5b5
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/node-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
type: string

jobs:
build:
release:
name: 'Semantic Release NodeJS'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ '18.x' ]
outputs:
NEW_TAG: ${{ steps.bump-tag.outputs.new_tag }}

steps:
- name: Checkout Repository
Expand Down Expand Up @@ -41,6 +44,19 @@ jobs:
RELEASE_BRANCHES: 'master,main'
PRERELEASE: true

- name: Sync package.json version
run: |
TAG="${{ steps.bump-tag.outputs.new_tag }}"
NEW_VERSION="${TAG#v}"
npm version $NEW_VERSION --no-git-tag-version -m "Update package.json version [skip-ci]"
git push origin HEAD:${{ github.ref }}
release-docker:
name: 'Build and Release Docker Image'
runs-on: ubuntu-latest
needs: release
env:
IMAGE_NAME: ${{ github.repository_owner }}/${{ github.repository_name }}:${{ needs.release.outputs.NEW_TAG }}
steps:
- name: Login to GitHub Packages
uses: docker/login-action@v3
with:
Expand All @@ -54,12 +70,5 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.repository_name }}:${{ steps.bump-tag.outputs.new_tag }}
- name: Sync package.json version
run: |
TAG="${{ steps.bump-tag.outputs.new_tag }}"
NEW_VERSION="${TAG#v}"
npm version $NEW_VERSION --no-git-tag-version -m "Update package.json version [skip-ci]"
git push origin HEAD:${{ github.ref }}
tags: |
ghcr.io/${{ env.IMAGE_NAME }}

0 comments on commit 4dff5b5

Please sign in to comment.