run test in amd64 self hosted #32
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: Release Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DOCKERHUB_OPERATOR_REPO: ${{ vars.DOCKERHUB_USER }}/operator | |
| DOCKERHUB_SERVER_REPO: ${{ vars.DOCKERHUB_USER }}/server | |
| DOCKERHUB_CONSOLE_REPO: ${{ vars.DOCKERHUB_USER }}/console | |
| DOCKERHUB_INIT_REPO: ${{ vars.DOCKERHUB_USER }}/init | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| runs-on: ${{ matrix.arch }} | |
| environment: release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set DOCKER_CONFIG | |
| run: | | |
| mkdir -p ${{ github.workspace }}/.docker | |
| echo "DOCKER_CONFIG=${{ github.workspace }}/.docker" >> $GITHUB_ENV | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - run: | | |
| docker context create desktop-linux || true | |
| docker context use desktop-linux | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver-opts: image=moby/buildkit:master | |
| version: v0.15.1 | |
| endpoint: desktop-linux | |
| - name: Build and push operator | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| target: operator | |
| push: true | |
| provenance: false | |
| platforms: linux/${{ matrix.arch }} | |
| tags: ${{ env.DOCKERHUB_OPERATOR_REPO}}:latest-${{ matrix.arch }} | |
| cache-from: type=gha,scope=operator-${{ github.ref}}-${{ matrix.arch }} | |
| cache-to: type=gha,scope=operator-${{ github.ref}}-${{ matrix.arch }},mode=max | |
| - name: Build and push server | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| target: server | |
| push: true | |
| provenance: false | |
| platforms: linux/${{ matrix.arch }} | |
| tags: ${{ env.DOCKERHUB_SERVER_REPO}}:latest-${{ matrix.arch }} | |
| cache-from: type=gha,scope=server-${{ github.ref}}-${{ matrix.arch }} | |
| cache-to: type=gha,scope=server-${{ github.ref}}-${{ matrix.arch }},mode=max | |
| - name: Build and push console | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| target: console | |
| push: true | |
| provenance: false | |
| platforms: linux/${{ matrix.arch }} | |
| tags: ${{ env.DOCKERHUB_CONSOLE_REPO}}:latest-${{ matrix.arch }} | |
| cache-from: type=gha,scope=console-${{ github.ref}}-${{ matrix.arch }} | |
| cache-to: type=gha,scope=console-${{ github.ref}}-${{ matrix.arch }},mode=max | |
| - name: Build and push init container | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.initContainer | |
| push: true | |
| provenance: false | |
| platforms: linux/${{ matrix.arch }} | |
| tags: ${{ env.DOCKERHUB_INIT_REPO}}:latest-${{ matrix.arch }} | |
| cache-from: type=gha,scope=init-${{ github.ref}}-${{ matrix.arch }} | |
| cache-to: type=gha,scope=init-${{ github.ref}}-${{ matrix.arch }},mode=max | |
| finalize: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: release | |
| steps: | |
| - name: Set DOCKER_CONFIG | |
| run: | | |
| mkdir -p ${{ github.workspace }}/.docker | |
| echo "DOCKER_CONFIG=${{ github.workspace }}/.docker" >> $GITHUB_ENV | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Merge operator image tags | |
| uses: Noelware/docker-manifest-action@master | |
| with: | |
| inputs: ${{ env.DOCKERHUB_OPERATOR_REPO }}:latest,${{ env.DOCKERHUB_OPERATOR_REPO }}:${{ github.sha }} | |
| images: ${{ env.DOCKERHUB_OPERATOR_REPO }}:latest-amd64,${{ env.DOCKERHUB_OPERATOR_REPO }}:latest-arm64 | |
| push: true | |
| - name: Merge server image tags | |
| uses: Noelware/docker-manifest-action@master | |
| with: | |
| inputs: ${{ env.DOCKERHUB_SERVER_REPO }}:latest,${{ env.DOCKERHUB_SERVER_REPO }}:${{ github.sha }} | |
| images: ${{ env.DOCKERHUB_SERVER_REPO }}:latest-amd64,${{ env.DOCKERHUB_SERVER_REPO }}:latest-arm64 | |
| push: true | |
| - name: Merge console image tags | |
| uses: Noelware/docker-manifest-action@master | |
| with: | |
| inputs: ${{ env.DOCKERHUB_CONSOLE_REPO }}:latest,${{ env.DOCKERHUB_CONSOLE_REPO }}:${{ github.sha }} | |
| images: ${{ env.DOCKERHUB_CONSOLE_REPO }}:latest-amd64,${{ env.DOCKERHUB_CONSOLE_REPO }}:latest-arm64 | |
| push: true | |
| - name: Merge init container image tags | |
| uses: Noelware/docker-manifest-action@master | |
| with: | |
| inputs: ${{ env.DOCKERHUB_INIT_REPO }}:latest,${{ env.DOCKERHUB_INIT_REPO }}:${{ github.sha }} | |
| images: ${{ env.DOCKERHUB_INIT_REPO }}:latest-amd64,${{ env.DOCKERHUB_INIT_REPO }}:latest-arm64 | |
| push: true |