Skip to content

fix: add limit

fix: add limit #16

name: Service CI/CD Pipeline
on:
push:
branches:
- main
env:
project-directory: ./
jobs:
test:
name: Test
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, 'skip-ci')
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: npm clean install
run: npm ci
working-directory: ${{ env.project-directory }}
- name: run ESLint
run: npm run eslint
working-directory: ${{ env.project-directory }}
release:
name: Release
needs: test
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, 'skip-ci') &&
github.event_name == 'push' &&
github.repository_owner == 'Greenstand'
steps:
- uses: actions/checkout@v2
- name: Use Node.js 20.x # semantic release
uses: actions/setup-node@v1
with:
node-version: '20.x'
- name: npm clean install
run: npm ci
working-directory: ${{ env.project-directory }}
- run: npm i -g semantic-release @semantic-release/{git,exec,changelog}
- run: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build snapshot and push on merge
id: docker_build_release
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: greenstand/${{ github.event.repository.name }}:${{ steps.package-version.outputs.current-version }}