Skip to content

Pin semantic release version & specify node version for release github action #127

Pin semantic release version & specify node version for release github action

Pin semantic release version & specify node version for release github action #127

Workflow file for this run

# This workflow will build docs and deploy it to https://rangle.github.io/radius-tracker/
# For more information see: https://github.com/marketplace/actions/deploy-to-github-pages
name: Build and Deploy
on:
push:
branches:
- main
pull_request:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
PR_NUM: ${{ github.event.pull_request.number }}
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v2
- name: Install Yarn 🚧
if: ${{ env.ACT }}
run: npm install -g yarn
- name: Install Rsync πŸ“š
if: ${{ env.ACT }}
run: apt-get update && apt-get install -y rsync
- name: Comment on PR πŸ’¬
if: github.ref != 'refs/heads/main'
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "Initializing deploy of documentation site preview... ⏳"
- name: Set BASE_URL for Preview Build πŸ”¨
if: github.ref != 'refs/heads/main'
run: echo BASE_URL="https://rangle.github.io/radius-tracker/pull/${{ env.PR_NUM }}" >> $GITHUB_ENV
- name: Cache build artifacts πŸ’Ύ
if: github.ref == 'refs/heads/main'
uses: actions/cache@v3
id: cache
with:
key: ${{ runner.os }}-${{ hashFiles('src/docs/pages', 'src/docs/next.config.js', 'src/docs/theme.config.jsx') }}
path: src/docs/out
- name: Build Docs Site πŸ“–
if: steps.cache.outputs.cache-hit != 'true'
run: yarn docs-build
- name: Deploy (main branch) πŸš€
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
clean-exclude: pull
branch: gh-pages
folder: src/docs/out
token: ${{secrets.GITHUB_TOKEN}}
- name: Deploy (PR Preview) πŸ”Ž
if: github.ref != 'refs/heads/main'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: src/docs/out
target-folder: pull/${{ env.PR_NUM }}
token: ${{ secrets.GITHUB_TOKEN }}
clean: false
- name: Update PR comment πŸ’¬
if: github.ref != 'refs/heads/main'
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "πŸš€ Deploy of docs site preview has been started. It will take a minute or two for changes to appear on the site. See changes here: ${{ env.BASE_URL }}"