Skip to content

Build and Deploy

Build and Deploy #322

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [master]
paths:
- 'engblogs.opml'
- 'template.html'
- 'main.go'
- '.github/workflows/build.yml'
schedule:
- cron: '0 */3 * * *' # Every 3 hours
workflow_dispatch: # Manual trigger
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: Restore cache
uses: actions/cache@v4
with:
path: cache.json
key: feed-cache-${{ github.run_id }}
restore-keys: feed-cache-
- name: Build site
run: go run main.go
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4