2025-02-17 07:10:40 +01:00
|
|
|
name: Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
2025-02-17 07:14:54 +01:00
|
|
|
workflow_dispatch:
|
2025-02-17 07:10:40 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
FORCE_COLOR: 2
|
2025-02-17 07:13:42 +01:00
|
|
|
NODE: 18
|
2025-02-17 07:10:40 +01:00
|
|
|
|
|
|
|
jobs:
|
2025-02-17 07:14:54 +01:00
|
|
|
build:
|
2025-02-17 07:10:40 +01:00
|
|
|
runs-on: ubuntu-latest
|
2025-02-17 07:14:54 +01:00
|
|
|
if: github.repository == 'twbs/icons' && startsWith(github.ref, 'refs/tags/v')
|
2025-02-17 07:10:40 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone repository
|
2025-02-17 07:16:14 +01:00
|
|
|
uses: actions/checkout@v4
|
2025-02-17 07:13:42 +01:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2025-02-17 07:10:40 +01:00
|
|
|
|
|
|
|
- name: Set up Node.js
|
2025-02-17 07:16:14 +01:00
|
|
|
uses: actions/setup-node@v4
|
2025-02-17 07:10:40 +01:00
|
|
|
with:
|
|
|
|
node-version: "${{ env.NODE }}"
|
|
|
|
cache: npm
|
|
|
|
|
|
|
|
- name: Install npm dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
2025-02-17 07:14:54 +01:00
|
|
|
- name: Prepare release
|
|
|
|
run: npm run release
|
2025-02-17 07:10:40 +01:00
|
|
|
|
|
|
|
- name: Deploy docs
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
allow_empty_commit: false
|
|
|
|
personal_token: ${{ secrets.PERSONAL_TOKEN }}
|
|
|
|
publish_branch: gh-pages
|
|
|
|
publish_dir: ./_site/
|
|
|
|
|
|
|
|
publish:
|
2025-02-17 07:14:54 +01:00
|
|
|
needs: build
|
2025-02-17 07:10:40 +01:00
|
|
|
runs-on: ubuntu-latest
|
2025-02-17 07:14:54 +01:00
|
|
|
if: github.repository == 'twbs/icons' && startsWith(github.ref, 'refs/tags/v')
|
2025-02-17 07:14:35 +01:00
|
|
|
|
2025-02-17 07:10:40 +01:00
|
|
|
steps:
|
2025-02-17 07:13:42 +01:00
|
|
|
- name: Clone repository
|
2025-02-17 07:16:14 +01:00
|
|
|
uses: actions/checkout@v4
|
2025-02-17 07:13:42 +01:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2025-02-17 07:10:40 +01:00
|
|
|
|
2025-02-17 07:16:14 +01:00
|
|
|
- uses: actions/setup-node@v4
|
2025-02-17 07:10:40 +01:00
|
|
|
with:
|
|
|
|
node-version: "${{ env.NODE }}"
|
|
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
|
|
|
|
- name: Publish on npm
|
|
|
|
run: npm publish
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|