Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Publish Release

Publish Release #3263

Workflow file for this run

name: DotCMS/core-web Tests
on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
push:
branches:
- master
- release-*
jobs:
build:
if: github.event.pull_request.draft == false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.CICD_GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ toJson(github) }}
PULL_REQUEST_URL: ${{ github.event.pull_request._links.html.href }}
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
HEAD_REF: ${{ github.head_ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 1
- uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Configuring Node.js
uses: actions/setup-node@v2-beta
with:
node-version: '16.13.2'
- name: Installing dependencies
run: npm install
- name: Building for production
run: npm run nx build dotcms-ui -- --with-deps --prod
- name: Running tests
id: test_run
run: |
if ! (npm run nx test --target=dotcms-ui --prod) then
echo "::set-output name=status::failure";
echo "::set-output name=color::#ff2400";
exit 1;
else
echo "::set-output name=status::success";
echo "::set-output name=color::#5E7D00";
fi
- name: Push Tests to GitHub
id: persist_results
if: success() || failure()
run: |
chmod +x .cicd/github.sh && source .cicd/github.sh
persistResults
echo "::set-output name=message::$(logResults)";
- name: Slack Notification
if: success() || failure()
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: core-web
SLACK_ICON: https://avatars.slack-edge.com/2020-09-21/1362682893351_5b474f175640cf5f5912_72.png
SLACK_COLOR: ${{ steps.test_run.outputs.color }}
SLACK_TITLE: 'Report: (${{ steps.test_run.outputs.status }})'
SLACK_MESSAGE: ${{ steps.persist_results.outputs.message }}
SLACK_FOOTER: ${{ env.PULL_REQUEST_URL }}