Trigger Nightly #525
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: Trigger Nightly | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
jobs: | |
commits: | |
name: Commits | |
runs-on: ubuntu-latest | |
outputs: | |
numCommits: ${{ steps.numCommits.outputs.commits }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get new commits | |
id: numCommits | |
run: echo "commits=$(git log --oneline --since '24 hours ago' | wc -l)" >> "$GITHUB_OUTPUT" | |
nightly: | |
name: Nightly | |
runs-on: ubuntu-latest | |
needs: commits | |
if: ${{ needs.commits.outputs.numCommits > 0 }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Install templ | |
run: go install github.com/a-h/templ/cmd/templ@latest | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: "latest" | |
extended: true | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
- name: Build and test | |
run: task test | |
- name: Build nightly builds | |
run: | | |
go run ./releases/main.go -package github.com/reaper47/recipya -tag nightly | |
- uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: nightly | |
prerelease: true | |
title: Nightly | |
files: ./releases/nightly/*.zip | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: reaper99/recipya@nightly | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: ./deploy/Dockerfile | |
push: true | |
tags: reaper99/recipya:nightly | |
labels: ${{ steps.meta.outputs.labels }} |