Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

main

main #229

Workflow file for this run

name: main
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Check if there's new commit
id: check
run: |
check=$(curl -s https://api.github.com/repos/caddyserver/caddy-docker/commits/master | jq -r "((now - (.commit.author.date | fromdateiso8601) ) / (60*60*24) | trunc)")
echo $check
echo check=$check >> $GITHUB_ENV
- name: Checkout
if: env.check == 0
uses: actions/checkout@v2
- name: Set up QEMU
if: env.check == 0
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: env.check == 0
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: env.check == 0
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
if: env.check == 0
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/caddy-cloudflare:latest