Skip to content

Build nightly

Build nightly #37

Workflow file for this run

name: Build nightly
on:
schedule:
- cron: "0 0 * * *"
jobs:
check:
runs-on: 'ubuntu-latest'
steps:
- uses: octokit/[email protected]
id: check_last_run
with:
route: GET /repos/${{github.repository}}/actions/workflows/main.yml/runs?per_page=1&status=completed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: "echo Last daily build: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}"
outputs:
last_sha: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}
build:
runs-on: ubuntu-latest
needs: [check]
if: needs.check.outputs.last_sha != github.sha
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push tagged Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/vrep:latest