Skip to content

Build and Publish #11203

Build and Publish

Build and Publish #11203

Workflow file for this run

name: Build and Publish
on:
# TODO: setup periodic trigger later
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: "5,35 * * * *"
concurrency: ${{ (github.ref == 'refs/heads/main' && 'update' ) || github.run_id }}
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: actions/cache@v3
with:
path: upstream
key: upstream
- name: Build
uses: actions-rs/cargo@v1
with:
command: run
args: --release --verbose
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'out'
- name: Upload output to B2
if: false
run: cargo run --package b2-sync out ${{ secrets.META_B2_BUCKET }}
env:
B2_APPLICATION_KEY: ${{ secrets.B2_APPLICATION_KEY }}
B2_APPLICATION_KEY_ID: ${{ secrets.B2_APPLICATION_KEY_ID }}
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1