build #239
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |