-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.3 KB
/
build-caddy.yml
File metadata and controls
50 lines (43 loc) · 1.3 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
name: build-caddy
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'info'
# schedule:
# Run at 02:01 on the 3rd of every month
# - cron: '1 2 3 * *'
env:
TZ: Asia/Shanghai
REGISTRY: ghcr.io
IMAGE_NAME: caddycfdns
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
with:
fetch-depth: 0
- name: Get current time
run: echo "BUILD_DATE=$(date +'%Y-%m-%d_%H-%M')" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.package_token }}
- name: Build and Push images
uses: docker/build-push-action@v3.3.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
tags: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.BUILD_DATE }}