docker-buildimage-varnish #14
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: docker-buildimage-varnish | |
on: | |
schedule: | |
- cron: '0 12 1 * *' | |
push: | |
branches: [ main ] | |
paths: | |
- 'docker/varnish/**' | |
- '.github/workflows/docker-buildimage-varnish.yml' | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_PASSWD }} | |
- | |
name: Login to Github Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- | |
name: Set build date | |
id: build-date | |
run: | | |
echo "ym=$(date +%Y-%m)" >> $GITHUB_OUTPUT | |
echo "date=$(date +%F)" >> $GITHUB_OUTPUT | |
- | |
name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: docker/varnish/ | |
file: docker/varnish/Dockerfile | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
tags: | | |
docker.io/gsmlg/varnish:${{ steps.build-date.outputs.ym }} | |
ghcr.io/gsmlg/varnish:${{ steps.build-date.outputs.ym }} | |
docker.io/gsmlg/varnish:latest | |
ghcr.io/gsmlg/varnish:latest |