Merge pull request #131 from axoflow/theme-update-250526 #317
This file contains hidden or 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: Publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
clean: true | |
show-progress: true | |
lfs: false | |
set-safe-directory: true | |
fetch-depth: 0 | |
- name: Set up Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Set up Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.122.0' | |
extended: true | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: | | |
cd themes/docsy | |
npm install | |
- name: Set up PostCSS | |
run: npm install --save-dev autoprefixer postcss-cli postcss | |
- name: Build | |
run: hugo --environment production | |
- name: Pagefind search index | |
run: npm_config_yes=true npx pagefind --output-subdir pagefind --site ./public | |
- name: Deploy to Cloudflare R2 | |
env: | |
AWS_S3_BUCKET: 'axosyslog-core-docs' | |
AWS_ACCESS_KEY_ID: ${{ secrets.R2_PUBLIC_EDITOR_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_PUBLIC_EDITOR_ACCESS_KEY_SECRET }} | |
AWS_S3_ENDPOINT: 'https://dc6bedf14f451ab276dc7caf3307af2a.r2.cloudflarestorage.com/' | |
AWS_REGION: 'auto' | |
SOURCE_DIR: 'public' | |
DESTINATION_DIR: 'docs/axosyslog-core' | |
run: | | |
aws s3 sync $SOURCE_DIR s3://$AWS_S3_BUCKET/$DESTINATION_DIR --endpoint-url $AWS_S3_ENDPOINT --region $AWS_REGION --checksum-algorithm CRC32 --delete |