Skip to content

build

build #234

Workflow file for this run

name: build
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 12 * * *"
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Fetch lego release version
run: |
LEGO_VERSION=$(curl -sL https://api.github.com/repos/go-acme/lego/releases/latest | jq -r ".tag_name")
echo "LEGO_VERSION=$LEGO_VERSION" >> $GITHUB_ENV
echo "Building with LEGO $LEGO_VERSION"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
# context: "{{defaultContext}}:mysubdir"
# context: .
push: true
tags: |
zen3515/acme-lego-cron:latest
zen3515/acme-lego-cron:${{ env.LEGO_VERSION }}
build-args: |
LEGO_VERSION=${{ env.LEGO_VERSION }}
platforms: |
linux/amd64
linux/arm/v7
linux/arm64