This repository has been archived by the owner on Nov 21, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/erxes/erxes-integrations …
…into develop
- Loading branch information
Showing
3 changed files
with
98 additions
and
40 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,89 @@ | ||
name: Publish Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-18.04 | ||
|
||
services: | ||
mongodb: | ||
image: mongo:3.6 | ||
ports: | ||
- 27017:27017 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 12.18.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.18.x | ||
|
||
- name: Get release version | ||
id: get_release_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | ||
|
||
# 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-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Integrations - Install dependencies | ||
run: | | ||
yarn install | ||
- name: Integrations - Lint | ||
run: | | ||
yarn lint | ||
- name: Integrations - Test | ||
run: | | ||
yarn test | ||
env: | ||
TEST_MONGO_URL: mongodb://localhost/test | ||
GOOGLE_CLIENT_ID: GOOGLE_CLIENT_ID | ||
GOOGLE_CLIENT_SECRET: GOOGLE_CLIENT_SECRET | ||
ENCRYPTION_KEY: aksljdklwjdaklsjdkwljaslkdjwkljd | ||
DOMAIN: http://localhost:3400 | ||
MAIN_APP_DOMAIN: http://localhost:3400 | ||
|
||
- name: Integrations - Build | ||
run: | | ||
rm -rf node_modules | ||
yarn install --production | ||
yarn build | ||
- name: Integrations - Build docker image | ||
run: | | ||
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
docker build -t erxes/erxes-integrations:${GITHUB_REF#refs/tags/} -f Dockerfile . | ||
docker push erxes/erxes-integrations:${GITHUB_REF#refs/tags/} | ||
- name: Prepare release assets | ||
run: | | ||
mkdir -p integrations | ||
mv dist integrations/dist | ||
mv node_modules integrations/node_modules | ||
mv package.json integrations/package.json | ||
tar -zcf erxes-integrations-${GITHUB_REF#refs/tags/}.tar.gz integrations/dist integrations/node_modules integrations/package.json | ||
- name: Upload release assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
erxes-integrations-${{ steps.get_release_version.outputs.VERSION }}.tar.gz | ||
name: Release ${{ steps.get_release_version.outputs.VERSION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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