Skip to content

Merge branch 'rc' of github.com:erxes/erxes into dev #1456

Merge branch 'rc' of github.com:erxes/erxes into dev

Merge branch 'rc' of github.com:erxes/erxes into dev #1456

name: Plugin engages Api CI
on:
push:
branches:
- dev
- master
- rc
- staging
paths:
- "packages/api-utils/**"
- "packages/plugin-engages-api/**"
- ".github/workflows/plugin-engages-api.yaml"
pull_request:
branches:
- dev
- master
- rc
- staging
paths:
- "packages/api-utils/**"
- "packages/plugin-engages-api/**"
- ".github/workflows/plugin-engages-api.yaml"
jobs:
api:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.20.x
uses: actions/setup-node@v4
with:
node-version: 18.20.x
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-api-plugin-engages
restore-keys: |
${{ runner.os }}-yarn-api-
${{ runner.os }}-yarn-
- name: Build
run: |
cp -r builder dist
cd dist
yarn install
yarn build plugin engages
- name: Build docker image
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/staging' )
run: |
cd dist/erxes
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker buildx build -t erxes/plugin-engages-api:${GITHUB_REF#refs/heads/} -f Dockerfile .
docker push erxes/plugin-engages-api:${GITHUB_REF#refs/heads/}