on-release #5
Workflow file for this run
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: on-release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- bs3* | |
env: | |
NX_BRANCH: ${{ github.event.number }} | |
NX_RUN_GROUP: ${{ github.run_id }} | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
MOZ_HEADLESS: 1 | |
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
# one run | |
one_run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
# install dependencies | |
install: | |
runs-on: ubuntu-latest | |
needs: one_run | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- run: npm ci | |
if: steps.cache.outputs.cache-hit != 'true' | |
# build ngx-bootstrap | |
build: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- uses: actions/cache@v3 | |
with: | |
path: dist | |
key: dist-${{ github.run_id }} | |
- run: | | |
npx nx build ngx-bootstrap --runner=cloud --configuration=production | |
npx ng build --runner=cloud --configuration=production | |
# update release notes in github | |
# update_release_draft: | |
# needs: install | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/cache@v3 | |
# with: | |
# path: node_modules | |
# key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
# - run: npm run release | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# update gh_pages | |
gh_pages_deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
ref: 'gh-pages' | |
path: 'gh-pages' | |
- uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- uses: actions/cache@v3 | |
with: | |
path: dist | |
key: dist-${{ github.run_id }} | |
# - run: npm run scully | |
- run: npx ts-node ./scripts/gh-pages-predeploy.ts | |
- run: | | |
cd gh-pages | |
git config user.email gh-actions-${GITHUB_ACTOR}@github.com | |
git config user.name $GITHUB_ACTOR | |
git add -A | |
git commit -am "ci: gh-pages update" | |
continue-on-error: true | |
- name: push to gh-pages | |
uses: ad-m/[email protected] | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: 'gh-pages' | |
directory: 'gh-pages' | |
# publish package to another branch | |
npm_publish: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- uses: actions/cache@v3 | |
with: | |
path: dist | |
key: dist-${{ github.run_id }} | |
# Deploy to local repo | |
# see: https://github.com/marketplace/actions/push-git-subdirectory-as-branch | |
- name: Deploy | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: dist | |
FOLDER: dist/ngx-bootstrap | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: ${{ github.ref_name }}-release |