Deploy Nightly #159
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
# 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: write-all | |
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 tooling-build | |
- name: Build nightly | |
run: task 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/* | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and publish docker nightly | |
run: docker buildx build . -f Dockerfile -t ghcr.io/itsnotgoodname/ipcmanview:nightly --provenance=false --platform=linux/amd64,linux/arm/v7,linux/arm64/v8 --push |