Skip to content

Create ui-c8y-1021-9-0-limits-tab-in-tenant-details-7260-graft-release-cd-7669.md #7640

Create ui-c8y-1021-9-0-limits-tab-in-tenant-details-7260-graft-release-cd-7669.md

Create ui-c8y-1021-9-0-limits-tab-in-tenant-details-7260-graft-release-cd-7669.md #7640

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request_target:
types:
# defaults
- opened
- synchronize
- reopened
- closed
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.action == 'opened' }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
# Build job
build:
name: Build Hugo
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.132.2
steps:
- name: Install Hugo CLI
if: ${{ github.event.pull_request.state != 'closed' }}
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Setup base URL env var
run: |
echo BASEURL="https://${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.job }}-pr-${{ github.event.number }}.surge.sh" >> $GITHUB_ENV
- name: Report base URL env var
run: echo "${{ env.BASEURL }}"
- name: Checkout
if: ${{ github.event.pull_request.state != 'closed' }}
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.number }}/merge
submodules: recursive
fetch-depth: 1
- name: Build with Hugo
if: ${{ github.event.pull_request.state != 'closed' }}
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--baseURL "${{ env.BASEURL }}/"
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g surge
- name: Deploy to surge
if: ${{ github.event.pull_request.state != 'closed' }}
run: |
surge ./public ${{ env.BASEURL }} --token ${{ secrets.SURGE_TOKEN }}
- name: Remove from surge
if: ${{ github.event.pull_request.state == 'closed' }}
run: |
surge teardown ${{ env.BASEURL }} --token ${{ secrets.SURGE_TOKEN }}
- name: Run Summary
if: ${{ github.event.pull_request.state != 'closed' }}
run: echo "Preview available **[here](${{ env.BASEURL }})**" >> $GITHUB_STEP_SUMMARY
- name: Add Comment to PR
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Preview available **[here](${{ env.BASEURL }})**'
})