Skip to content

Nightly Release

Nightly Release #952

name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
jobs:
check_code_change:
name: Check code change
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.code_change.outputs.should_run }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check if code has changed with 24 hours
continue-on-error: true
id: code_change
run: |
if [[ $(git rev-list --after="24 hours" --first-parent HEAD) ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
fi
build_tag_publish:
name: Build, tag and publish Docker image
runs-on: ubuntu-latest
needs: check_code_change
if: needs.check_code_change.outputs.should_run == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get short SHA
id: short_sha
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: "ghcr.io/jef/streetmerchant:nightly,ghcr.io/jef/streetmerchant:${{ steps.short_sha.outputs.short_sha }}"