Merge pull request #84 from feelpp/82-fix-deployment #216
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
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json | |
name: Generate Antora UI with Gulp | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-bundle: | |
runs-on: ubuntu-latest | |
name: Build UI Bundle | |
if: "!contains(github.event.head_commit.message, 'ui skip')" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Generates Antora UI Bundle | |
run: gulp bundle | |
- name: Upload UI Bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ui-bundle | |
path: build/ui-bundle.zip | |
build-docs: | |
# depends on build-bundle job | |
needs: build-bundle | |
runs-on: ubuntu-latest | |
name: Build Antora UI | |
if: "!contains(github.event.head_commit.message, 'docs skip')" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download UI Bundle | |
uses: actions/download-artifact@v4 | |
with: | |
name: ui-bundle | |
path: build | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Build Antora Site | |
run: | | |
npm run antora | |
- name: Deploy Antora UI to GitHub Pages | |
if: ${{ github.ref_name == 'main' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: build/site # The folder the action should deploy. | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
build/ui-bundle.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref_name }} | |
generate_release_notes: true | |
draft: false | |
prerelease: false |