Skip to content

docker-buildimage-devdocs #105

docker-buildimage-devdocs

docker-buildimage-devdocs #105

name: docker-buildimage-devdocs
on:
schedule:
- cron: '0 6 * * 0'
push:
branches: [ main ]
paths:
- 'docker/devdocs/**'
- '.github/workflows/docker-buildimage-devdocs.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/devdocs/
file: docker/devdocs/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
build-args: |
BUILD_MONTH=${{ steps.build-date.outputs.ym }}
BUILD_DATE=${{ steps.build-date.outputs.date }}
tags: |
docker.io/gsmlg/devdocs:${{ steps.build-date.outputs.date }}
ghcr.io/gsmlg/devdocs:${{ steps.build-date.outputs.date }}
docker.io/gsmlg/devdocs:latest
ghcr.io/gsmlg/devdocs:latest