-
Notifications
You must be signed in to change notification settings - Fork 10
61 lines (53 loc) · 1.71 KB
/
docker-nightly.yml
File metadata and controls
61 lines (53 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Nightly Docker
on:
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-push-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for recent changes
id: git_log
run: |
if [ -z "$(git log --since='2 days ago')" ]; then
echo "No recent changes found in the last 2 days. Skipping build."
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "Recent changes found. Proceeding with build."
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Set up Docker Buildx
if: steps.git_log.outputs.changed == 'true'
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
if: steps.git_log.outputs.changed == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
if: steps.git_log.outputs.changed == 'true'
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/pinkfuwa/llumen
tags: type=raw,value=nightly
- name: Build and push nightly image
if: steps.git_log.outputs.changed == 'true'
uses: docker/build-push-action@v5
with:
context: .
file: ./package/Dockerfile
platforms: "linux/amd64,linux/arm64"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max