Merge branch 'rc' of github.com:erxes/erxes into dev #2006
This file contains hidden or 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: Plugin inbox Api CI | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
- rc | |
- staging | |
paths: | |
- "packages/api-utils/**" | |
- "packages/plugin-inbox-api/**" | |
- ".github/workflows/plugin-inbox-api.yaml" | |
pull_request: | |
branches: | |
- dev | |
- master | |
- rc | |
- staging | |
paths: | |
- "packages/api-utils/**" | |
- "packages/plugin-inbox-api/**" | |
- ".github/workflows/plugin-inbox-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-inbox | |
restore-keys: | | |
${{ runner.os }}-yarn-api- | |
${{ runner.os }}-yarn- | |
- name: Build | |
run: | | |
cp -r builder dist | |
cd dist | |
yarn install | |
yarn build plugin inbox | |
- 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-inbox-api:${GITHUB_REF#refs/heads/} -f Dockerfile . | |
docker push erxes/plugin-inbox-api:${GITHUB_REF#refs/heads/} |