Skip to content

Deploy Nightly

Deploy Nightly #146

Workflow file for this run

# yaml-language-server: https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
name: Deploy Nightly
on:
schedule:
- cron: "0 2 * * *" # run at 2 AM UTC
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-22.04
outputs:
nightly: ${{ steps.nightly.outputs.nightly }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: nightly
name: Check if current branch is nightly
run: (git tag --points-at HEAD | grep -wq "nightly" && echo "nightly=true") || echo "nightly=false" >> $GITHUB_OUTPUT
nightly:
needs: [check]
if: ${{ needs.check.outputs.nightly == 'false' }}
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Set up Protoc
uses: arduino/setup-protoc@v3
with:
version: "25.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up tooling
run: make workflow-tooling
- name: Build nightly
run: make workflow-nightly
- name: Publish nightly
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete nightly --yes || true
git push origin :nightly || true
gh release create --prerelease --title "Nightly $(date +'%Y-%m-%d')" --notes "" --target $GITHUB_SHA nightly dist/artifacts/*