Skip to content

Deploy Website

Deploy Website #144

name: Deploy Website
on:
push:
branches: [main]
paths:
- 'website/**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- uses: peaceiris/actions-hugo@v3
with:
hugo-version: latest
extended: true
- run: bun install
- run: bun run assets
- name: Generate changelog content from CHANGELOG.md
working-directory: .
run: |
{
echo '---'
echo 'title: Changelog'
echo 'layout: changelog'
echo 'hideInstall: true'
echo 'translationKey: changelog'
echo '---'
sed -e '1{/^# Changelog$/d;}' -e 's|compare/v[0-9.]*\.\.\.v\([0-9.]*\)|releases/tag/v\1|g' CHANGELOG.md
} > website/content/changelog.md
for lang in ca es sv; do cp website/content/changelog.md website/content/$lang/changelog.md; done
- name: Download appcast.xml from latest release
working-directory: .
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download --repo "$GITHUB_REPOSITORY" --pattern "appcast.xml" --output website/static/appcast.xml
- run: hugo
- uses: actions/upload-pages-artifact@v4
with:
path: website/public
retention-days: 1
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5