cron tasks #1701
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: cron tasks | |
on: | |
repository_dispatch: | |
types: [schedule] | |
workflow_dispatch: | |
inputs: | |
args: | |
default: "" | |
description: "args to build" | |
type: string | |
required: false | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**.md" | |
schedule: | |
- cron: "9 */12 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
concurrency: build | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "npm" | |
- name: install wrangler | |
run: npm install -g wrangler | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.29.4 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.deno | |
~/.cache/deno | |
key: ${{ runner.os }}-deno-${{ hashFiles('**/*deps.ts') }} | |
- run: make prod-load | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
AWS_ENDPOINT: ${{secrets.AWS_ENDPOINT}} | |
- run: make install | |
- run: "make prod-build args='${{ github.event.inputs.args }}'" | |
id: source | |
continue-on-error: true | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
AWS_ENDPOINT: ${{secrets.AWS_ENDPOINT}} | |
PUSH: 1 | |
DIST_REPO: ${{ secrets.DIST_REPO }} | |
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | |
- name: upload files | |
run: make prod-upload | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
AWS_ENDPOINT: ${{secrets.AWS_ENDPOINT}} | |
- name: upload temp folder to github action for debug | |
uses: actions/upload-artifact@v3 | |
with: | |
name: temp | |
path: temp | |
if-no-files-found: ignore | |
- name: throw if build failed | |
if: steps.source.outcome == 'failure' | |
run: | | |
echo "::error::prod-build failed" | |
exit 1 | |
- name: Publish pages | |
if: true | |
run: make prod-publish | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{secrets.CLOUDFLARE_ACCOUNT_ID}} | |
CLOUDFLARE_API_TOKEN: ${{secrets.CLOUDFLARE_API_TOKEN}} |