Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 25 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
id: branch
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install dependencies
run: npm ci --legacy-peer-deps
Expand All @@ -23,44 +29,20 @@ jobs:
- name: Build documentation and demo site
run: npm run build-storybook

#- uses: codfish/semantic-release-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Deploy documentation to GitHub Pages
if: github.ref == 'refs/heads/release/rc'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist/storybook
target-folder: rc

# npm publishing uses OIDC trusted publishing (no NPM_TOKEN): the
# @semantic-release/npm plugin exchanges the GitHub Actions OIDC token
# (id-token: write, above) for a short-lived npm token via the package's
# configured trusted publisher, and publishes with provenance.
- name: Run semantic release and publish new version to npm
if: github.ref == 'refs/heads/release/rc'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run semantic-release

# - name: Set base href
# run: ./node_modules/.bin/replace '<base href=(.*?)>' '<base href="/${{ github.event.repository.name }}/${{ steps.branch.outputs.branch }}/">' dist/docs/index.html

# - name: Set build (run) number
# run: ./node_modules/.bin/replace '##BUILD_NUMBER##' '${{ github.run_number }}' www/index.html

- name: Get last release
# if: steps.semantic.outputs.new-release-published !== 'true'
id: version
uses: abatilo/release-info-action@v1.3.0
with:
owner: hjalmers
repo: angular-generic-table

#- name: Set version number after release
# if: steps.semantic.outputs.new-release-published == 'true'
# run: ./node_modules/.bin/replace '##VERSION##' 'v${{ steps.semantic.outputs.release-version }}' www/index.html

#- name: Set version number
# if: steps.semantic.outputs.new-release-published != 'true'
# run: ./node_modules/.bin/replace '##VERSION##' '${{ steps.version.outputs.latest_tag }}' www/index.html

- name: Deploy documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.4.1
with:
ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist/storybook # The folder the action should deploy.
TARGET_FOLDER: ${{ steps.branch.outputs.branch }} # The folder the action should deploy to.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
Loading
Loading