Skip to content

Merge pull request #6076 from erxes/bug-and-improvement #1413

Merge pull request #6076 from erxes/bug-and-improvement

Merge pull request #6076 from erxes/bug-and-improvement #1413

Workflow file for this run

name: Api core CI
on:
push:
branches:
- dev
- master
- rc
- v2
- staging
paths:
- "packages/api-utils/**"
- "packages/core/**"
- ".github/workflows/core.yaml"
jobs:
core:
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/master/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-core
restore-keys: |
${{ runner.os }}-yarn-api-
${{ runner.os }}-yarn
- name: Build
run: |
cp -r builder dist
cd dist
yarn install
yarn build core
- 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' || github.ref == 'refs/heads/v2' )
run: |
cd dist/erxes
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker buildx build -t erxes/core:${GITHUB_REF#refs/heads/} -f Dockerfile .
docker push erxes/core:${GITHUB_REF#refs/heads/}