Skip to content

fix: add patch to support node 20.12+ #19

fix: add patch to support node 20.12+

fix: add patch to support node 20.12+ #19

Workflow file for this run

name: Continuous Deployment
on:
push:
branches: [main, dev]
workflow_dispatch:
env:
DH_USERNAME: ${{secrets.DOCKER_HUB_LOGIN}}
DH_TOKEN: ${{secrets.DOCKER_HUB_PWD}}
IMAGE_NAME: '2060-service-agent'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout service-agent
uses: actions/checkout@v4
- name: Setup node v20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
yarn install
- uses: codfish/semantic-release-action@v3
id: semantic
with:
branches: |
[
'main',
{
name: 'dev',
prerelease: true
}
]
plugins: |
[
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "refactor",
"release": "patch"
}
]
}
],
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
"@semantic-release/release-notes-generator",
]
- name: Log in to Docker Hub
if: steps.semantic.outputs.new-release-published == 'true'
run: |
echo "$DH_TOKEN" | docker login -u "$DH_USERNAME" --password-stdin
- name: Build Docker image
if: steps.semantic.outputs.new-release-published == 'true'
run: |
docker build -f Dockerfile -t $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} .
- name: Add tags to Docker image and push to Docker Hub
if: steps.semantic.outputs.new-release-published == 'true'
run: |
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}-${GITHUB_REF##*/}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}.${RELEASE_MINOR}-${GITHUB_REF##*/}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v${RELEASE_MAJOR}.${RELEASE_MINOR}.${RELEASE_PATCH:0:1}-${GITHUB_REF##*/}
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v$RELEASE_VERSION
docker push $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR-${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR-${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR.${RELEASE_PATCH:0:1}-${GITHUB_REF##*/}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_VERSION
- name: Add tags to Docker image and push to Docker Hub (specific to main)
if: github.ref == 'refs/heads/main' && steps.semantic.outputs.new-release-published == 'true'
run: |
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR
docker tag $DH_USERNAME/$IMAGE_NAME:${GITHUB_REF##*/} $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.${RELEASE_MINOR}.${RELEASE_PATCH:0:1}
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_MAJOR.$RELEASE_MINOR.${RELEASE_PATCH:0:1}