-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98a5958
commit d0dae9b
Showing
2 changed files
with
37 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,26 @@ | ||
name: "Deploy - On branch main Push" | ||
name: "Deploy - On branch main/release Push" | ||
on: | ||
pull_request: | ||
types: [closed] | ||
push: | ||
branches: | ||
- main | ||
- 'releases/**' | ||
|
||
paths-ignore: | ||
- "package.json" | ||
- "package-lock.json" | ||
- 'package.json' | ||
- 'package-lock.json' | ||
|
||
jobs: | ||
# required, as github uses a dynamic user on each run to checkout and execute. It causes permissions issues. | ||
Find-Container-Info: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
outputs: | ||
containerUser: ${{ steps.get-user.outputs.containerUser }} | ||
|
||
steps: | ||
- id: get-user | ||
run: echo "::set-output name=containerUser::`id -u`:`id -g`" | ||
|
||
Deploy-NPM-Component: | ||
needs: Find-Container-Info | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: registry.cloud.mov.ai/devops/npm-buildserver:latest | ||
credentials: | ||
username: ${{secrets.PORTUS_APP_USER}} | ||
password: ${{secrets.PORTUS_APP_TOKEN}} | ||
options: --user ${{ needs.Find-Container-Info.outputs.containerUser }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Raise App version | ||
run: | | ||
git config --global user.name 'Automatic Raise' | ||
git config --global user.email 'test@test' | ||
npm version patch -m "Automatic Bump of build version" | ||
git add package.* | ||
git push | ||
- name: Setup Github as proxy Registry | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16.x" | ||
registry-url: "https://npm.pkg.github.com/mov-ai" | ||
|
||
- name: Install dependencies | ||
run: npm ci --loglevel verbose | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Check NPM log on failure | ||
if: ${{ failure() }} | ||
run: cat /github/home/.npm/_logs/*.log | ||
# Skip tests for now | ||
#- name: Run tests | ||
# run: npm run test | ||
|
||
- name: Publish | ||
run: npm publish | ||
|
||
# [On Pull request merge] Since the pipeline will run, have a nice communication that is not doing anything. | ||
Skipped: | ||
if: github.event.pull_request.merged == false | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: registry.cloud.mov.ai/devops/tf-buildserver:latest | ||
credentials: | ||
username: ${{secrets.PORTUS_APP_USER}} | ||
password: ${{secrets.PORTUS_APP_TOKEN}} | ||
steps: | ||
- run: | | ||
echo PR #${{ github.event.number }} has been skipped since the pull request was not approved. | ||
CI: | ||
uses: MOV-AI/.github/.github/workflows/npm-workflow.yml@feature/v1 | ||
with: | ||
deploy: 'true' | ||
run_tests: 'false' | ||
secrets: | ||
auto_commit_user: ${{ secrets.RAISE_BOT_COMMIT_USER }} | ||
auto_commit_mail: ${{ secrets.RAISE_BOT_COMMIT_MAIL }} | ||
registry_user: ${{ secrets.PORTUS_APP_USER }} | ||
registry_password: ${{ secrets.PORTUS_APP_TOKEN }} | ||
gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
sonar_token: ${{ secrets.SONAR_TOKEN }} | ||
npm_token: ${{ secrets.NPM_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,26 @@ | ||
name: "CI - On branch dev Push" | ||
name: "CI - On main/dev/release branches" | ||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
- main | ||
- 'releases/**' | ||
paths-ignore: | ||
- "package.json" | ||
- "package-lock.json" | ||
- 'package.json' | ||
- 'package-lock.json' | ||
|
||
jobs: | ||
Test-NPM-Component: | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: registry.cloud.mov.ai/devops/npm-buildserver:latest | ||
credentials: | ||
username: ${{secrets.PORTUS_APP_USER}} | ||
password: ${{secrets.PORTUS_APP_TOKEN}} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Setup Github as proxy Registry | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16.x" | ||
registry-url: "https://npm.pkg.github.com/mov-ai" | ||
|
||
- name: Install dependencies | ||
run: npm ci --loglevel verbose | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Check NPM log on failure | ||
if: ${{ failure() }} | ||
run: cat /github/home/.npm/_logs/*.log | ||
|
||
# temporary comment till tests are fixed | ||
#- name: Run tests | ||
# run: npm run test | ||
CI: | ||
uses: MOV-AI/.github/.github/workflows/npm-workflow.yml@v1 | ||
with: | ||
deploy: 'false' | ||
run_tests: 'false' | ||
secrets: | ||
auto_commit_user: ${{ secrets.RAISE_BOT_COMMIT_USER }} | ||
auto_commit_mail: ${{ secrets.RAISE_BOT_COMMIT_MAIL }} | ||
registry_user: ${{ secrets.PORTUS_APP_USER }} | ||
registry_password: ${{ secrets.PORTUS_APP_TOKEN }} | ||
gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
sonar_token: ${{ secrets.SONAR_TOKEN }} | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
|