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