-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(automations): added feature automations
- Loading branch information
1 parent
34ff9e5
commit 984a418
Showing
242 changed files
with
23,334 additions
and
1,936 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Automations CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
paths: | ||
- "automations/**" | ||
- "!automations/**.md" | ||
- "!.github/**" | ||
- ".github/workflows/automations.yaml" | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- "automations/**" | ||
- "!automations/**.md" | ||
- "!.github/**" | ||
- ".github/workflows/automations.yaml" | ||
|
||
jobs: | ||
automations: | ||
runs-on: ubuntu-18.04 | ||
|
||
services: | ||
mongodb: | ||
image: mongo:4.0 | ||
ports: | ||
- 27017:27017 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 12.19.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.19.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 "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
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-automations-${{ hashFiles('yarn.lock', 'automations/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn-automations- | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: | | ||
yarn install | ||
cd automations | ||
yarn install --frozen-lockfile | ||
- name: Lint | ||
run: | | ||
yarn lint automations | ||
- name: Test | ||
run: | | ||
cd automations | ||
yarn test | ||
env: | ||
TEST_MONGO_URL: mongodb://localhost/test | ||
DOMAIN: http://localhost:4000 | ||
MAIN_APP_DOMAIN: http://localhost:4000 | ||
|
||
- name: Build | ||
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' ) | ||
run: | | ||
cd automations | ||
rm -rf node_modules | ||
yarn install --frozen-lockfile --production | ||
yarn build | ||
- name: Build docker image | ||
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' ) | ||
run: | | ||
cd automations | ||
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
docker build -t erxes/erxes-automations:${GITHUB_REF#refs/heads/} -f Dockerfile . | ||
docker push erxes/erxes-automations:${GITHUB_REF#refs/heads/} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.