Add CNCF website guidelines #107
Workflow file for this run
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
name: Radius Website | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build Hugo Website | |
if: github.event.action != 'closed' | |
runs-on: ubuntu-latest | |
env: | |
GOVER: '^1.17' | |
HUGO_ENV: production | |
SWA_BASE: 'brave-pond-00b49761e' | |
steps: | |
- name: Checkout website repo | |
uses: actions/checkout@v2 | |
- name: Setup Hugo | |
uses: peaceiris/[email protected] | |
with: | |
hugo-version: 0.102.3 | |
extended: true | |
- name: Build Hugo Site | |
run: | | |
if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then | |
STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.3.azurestaticapps.net/" | |
fi | |
hugo ${STAGING_URL+-b "$STAGING_URL"} | |
- name: Upload Hugo artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hugo_build | |
path: ./public/ | |
if-no-files-found: error | |
deploy: | |
name: Deploy Hugo Website | |
needs: ['build'] | |
runs-on: ubuntu-latest | |
environment: | |
name: latest | |
url: https://radapp.io | |
steps: | |
- name: Download Hugo artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: hugo_build | |
path: site/ | |
- name: Deploy static web app | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.SWA_TOKEN }} | |
skip_deploy_on_missing_secrets: true | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
action: "upload" | |
app_location: "site/" | |
api_location: "site/" | |
output_location: "" | |
skip_app_build: true |