feat: update prettier/eslint rules, add ci/cd #1
Workflow file for this run
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
name: Continuous Deployment | |
on: | |
push: | |
branches: [main, dev, dev-test] | |
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 | |
}, | |
{ | |
name: 'dev-test', | |
prerelease: true | |
} | |
] | |
plugins: | | |
[ | |
[ | |
"@semantic-release/commit-analyzer", | |
{ | |
"preset": "angular", | |
"releaseRules": [ | |
{ | |
"type": "refactor", | |
"release": "patch" | |
} | |
] | |
} | |
], | |
[ | |
"@semantic-release/npm", | |
{ | |
"npmPublish": false | |
} | |
], | |
"@semantic-release/release-notes-generator", | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: echo ${{ steps.semantic.outputs.release-version }} | |
- name: Log in to Docker Hub | |
run: | | |
echo "$DH_TOKEN" | docker login -u "$DH_USERNAME" --password-stdin | |
- name: Build Docker image | |
run: | | |
docker build -f Dockerfile -t $DH_USERNAME/$IMAGE_NAME:$RELEASE_VERSION-${GITHUB_REF##*/} . | |
- name: Push Docker image to Docker Hub | |
run: | | |
docker push $DH_USERNAME/$IMAGE_NAME:$RELEASE_VERSION-${GITHUB_REF##*/} |