Skip to content

caddy

caddy #17

Workflow file for this run

# This is free and unencumbered software released into the public domain.
name: caddy
on:
pull_request:
paths:
.github/workflows/caddy.yml
caddy
push:
branches:
- master
paths:
.github/workflows/caddy.yml
caddy
schedule:
- cron: 0 0 * * 1
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v4
- name: build
run: podman build --file containerfile --tag ghcr.io/ngarside/caddy:latest .
working-directory: caddy
- name: pipenv
run: pip install pipenv && pipenv install
- name: test
run: pipenv run pytest --rootdir caddy
- name: save
run: podman save --output caddy.tar ghcr.io/ngarside/caddy:latest
- name: upload
uses: actions/upload-artifact@v4
with:
compression-level: 9
name: caddy
path: caddy.tar
retention-days: 1
publish:
if: github.ref_name == 'master'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: download
uses: actions/download-artifact@v4
with:
name: caddy
- name: load
run: podman load --input caddy.tar
- name: login
run: podman login ghcr.io --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
- name: push
run: podman push ghcr.io/ngarside/caddy:latest