Build And Publish #7488
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: Build And Publish | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 * * * *' | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| # ONLY EVER RUN ONE | |
| concurrency: ${{ github.workflow }} | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Build static site | |
| run: | | |
| go run cmd/zwiftcal/main.go | |
| - name: Publish to Cloudflare Pages | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v4 | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| command: | | |
| pages deploy public/ --project-name=zwift-ical --branch=main | |