🐳 Build Debian Docker Image #150
This file contains hidden or 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 Debian Docker Image" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "04 05 * * 6" # every Saturday at 05:04 | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - "docker_build/debian_docker/**" | |
| - ".github/workflows/build_debian_docker.yml" | |
| jobs: | |
| build-amd: | |
| name: "Build AMD Docker image" | |
| runs-on: [ self-hosted, linux, k8s-runner-no-compose ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| job_path: "build_debian_docker" | |
| dockerfile_folder_path: "docker_build/debian_docker" | |
| image_url_base: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}" | |
| image_name: "debian_docker" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ${{ env.job_path }} | |
| fetch-depth: 0 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: "ghcr.io/${{ github.repository_owner }}" | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.ROBOT_GITHUB_PACKAGES_WRITE_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: "${{ env.job_path }}/${{ env.dockerfile_folder_path }}" | |
| push: true | |
| tags: "${{ env.image_url_base }}/${{ env.image_name }}:amd" | |
| build-arm: | |
| name: "Build ARM Docker image" | |
| runs-on: [ ubuntu-24.04-arm ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| job_path: "build_debian_docker" | |
| dockerfile_folder_path: "docker_build/debian_docker" | |
| image_url_base: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}" | |
| image_name: "debian_docker" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ${{ env.job_path }} | |
| fetch-depth: 0 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: "ghcr.io/${{ github.repository_owner }}" | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.ROBOT_GITHUB_PACKAGES_WRITE_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: "${{ env.job_path }}/${{ env.dockerfile_folder_path }}" | |
| push: true | |
| tags: "${{ env.image_url_base }}/${{ env.image_name }}:arm" | |
| build-manifest: | |
| name: "Create and push Docker manifest" | |
| runs-on: [ self-hosted, linux, k8s-runner-no-compose ] | |
| needs: [ build-amd, build-arm ] | |
| permissions: | |
| packages: write | |
| env: | |
| image_url_base: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}" | |
| image_name: "debian_docker" | |
| steps: | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: "ghcr.io/${{ github.repository_owner }}" | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.ROBOT_GITHUB_PACKAGES_WRITE_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Merge images into a single multiarch manifest | |
| run: | | |
| docker buildx imagetools create \ | |
| -t "${{ env.image_url_base }}/${{ env.image_name }}:latest" \ | |
| "${{ env.image_url_base }}/${{ env.image_name }}:amd" \ | |
| "${{ env.image_url_base }}/${{ env.image_name }}:arm" |