Skip to content

Cleanup and separate node & docker jobs #1

Cleanup and separate node & docker jobs

Cleanup and separate node & docker jobs #1

Workflow file for this run

name: Build and Release
on:
workflow_call:
inputs:
commit_sha:
required: true
type: string
jobs:
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
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Build
run: yarn build
- name: Bump version and push tag
id: bump-tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
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:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |

Check failure on line 73 in .github/workflows/node-ci-build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/node-ci-build.yml

Invalid workflow file

You have an error in your yaml syntax on line 73
ghcr.io/${{ env.IMAGE_NAME }}