fix slack notification message when PR got approved #41
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
name: Angular Build | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [12.x] | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | |
- uses: actions/cache@v2 | |
name: Cache yarn packages | |
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: Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: yarn install and run build | |
# Runs a set of commands using the runners shell | |
run: | | |
# npm install yarn | |
# todo: delete lock file | |
yarn install | |
yarn run build:prod | |
#create new tag only on push event | |
- name: Bump version and push tag | |
id: tag_version | |
if: ${{ github.event_name == 'push' }} | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.TOKEN }} | |
#create new release only on push event | |
- name: Push Build to Releases | |
if: ${{ github.event_name == 'push' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist/pull-request-notifications/*" | |
token: ${{ secrets.TOKEN }} | |
commit: master | |
tag: ${{ steps.tag_version.outputs.new_tag }} |