initial commit #49
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 docker images" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*.*.*" | |
| - "v*.*.*" | |
| - "*.*.*-*" | |
| - "v*.*.*-*" | |
| paths: | |
| - "dockers/**" | |
| - "Makefile" | |
| - ".github/workflows/**" | |
| pull_request: | |
| paths: | |
| - "dockers/**" | |
| - "Makefile" | |
| - ".github/workflows/**" | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_base: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| suffix: amd64 | |
| - platform: linux/arm64/v8 | |
| runner: ubuntu-24.04-arm | |
| suffix: arm64 | |
| runs-on: ${{ matrix.arch.runner }} | |
| environment: copilot | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Build and Push Docker Image | |
| uses: ./.github/actions/docker-build | |
| with: | |
| target: build_base | |
| docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }} | |
| docker_pass: ${{ secrets.DOCKERHUB_PASS }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| docker_push: true | |
| platform: ${{ matrix.arch.platform }} | |
| suffix: ${{ matrix.arch.suffix }} | |
| merge_base: | |
| needs: build_base | |
| runs-on: ubuntu-slim | |
| environment: copilot | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Merge and Push Manifest | |
| uses: ./.github/actions/docker-build | |
| with: | |
| target: merge_base | |
| docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }} | |
| docker_pass: ${{ secrets.DOCKERHUB_PASS }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| docker_push: true | |
| build: | |
| needs: merge_base | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| suffix: amd64 | |
| - platform: linux/arm64/v8 | |
| runner: ubuntu-24.04-arm | |
| suffix: arm64 | |
| image_target: | |
| - image: dart | |
| target: build_dart | |
| - image: docker | |
| target: build_docker | |
| - image: env | |
| target: build_env | |
| - image: gcloud | |
| target: build_gcloud | |
| - image: go | |
| target: build_go | |
| - image: kube | |
| target: build_k8s | |
| - image: nim | |
| target: build_nim | |
| - image: rust | |
| target: build_rust | |
| runs-on: ${{ matrix.arch.runner }} | |
| environment: copilot | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Build and Push Docker Image | |
| uses: ./.github/actions/docker-build | |
| with: | |
| target: ${{ matrix.image_target.target }} | |
| docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }} | |
| docker_pass: ${{ secrets.DOCKERHUB_PASS }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| docker_push: true | |
| platform: ${{ matrix.arch.platform }} | |
| suffix: ${{ matrix.arch.suffix }} | |
| merge: | |
| needs: build | |
| runs-on: ubuntu-slim | |
| environment: copilot | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image_target: | |
| - image: dart | |
| target: merge_dart | |
| - image: docker | |
| target: merge_docker | |
| - image: env | |
| target: merge_env | |
| - image: gcloud | |
| target: merge_gcloud | |
| - image: go | |
| target: merge_go | |
| - image: kube | |
| target: merge_k8s | |
| - image: nim | |
| target: merge_nim | |
| - image: rust | |
| target: merge_rust | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Merge and Push Manifest | |
| uses: ./.github/actions/docker-build | |
| with: | |
| target: ${{ matrix.image_target.target }} | |
| docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }} | |
| docker_pass: ${{ secrets.DOCKERHUB_PASS }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| docker_push: true | |
| build_dev: | |
| needs: merge | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| suffix: amd64 | |
| - platform: linux/arm64/v8 | |
| runner: ubuntu-24.04-arm | |
| suffix: arm64 | |
| runs-on: ${{ matrix.arch.runner }} | |
| environment: copilot | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Build and Push Docker Image | |
| uses: ./.github/actions/docker-build | |
| with: | |
| target: prod_build | |
| docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }} | |
| docker_pass: ${{ secrets.DOCKERHUB_PASS }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| docker_push: true | |
| platform: ${{ matrix.arch.platform }} | |
| suffix: ${{ matrix.arch.suffix }} | |
| merge_dev: | |
| needs: build_dev | |
| runs-on: ubuntu-slim | |
| environment: copilot | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Merge and Push Manifest | |
| uses: ./.github/actions/docker-build | |
| with: | |
| target: merge_dev | |
| docker_user: ${{ secrets.DOCKERHUB_USER || 'kpango' }} | |
| docker_pass: ${{ secrets.DOCKERHUB_PASS }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| docker_push: true |