name: Build Docker Image on: push: workflow_dispatch: permissions: contents: read packages: write jobs: docker: runs-on: ubuntu-latest if: github.repository != 'lillithkt/template' env: REPO: ${{ github.repository.name }} steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3.6.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.10.0 - name: Login to GitHub Container Registry uses: docker/login-action@v3.4.0 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: downcase REPO shell: bash run: | echo "REPO=${GITHUB_REPOSITORY##*/}" >>${GITHUB_ENV} - name: Build and push uses: docker/build-push-action@v6.15.0 with: push: true file: Dockerfile platforms: linux/amd64 tags: ghcr.io/lillithkt/${{ env.REPO }}:latest cache-from: type=gha cache-to: type=gha,mode=max