Merge pull request #30 from marvin-roesch/fix/multi-platform-build #95
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 | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'release-*' | |
| tags: | |
| - 'v*' | |
| jobs: | |
| buildx: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Prepare | |
| id: prepare | |
| run: | | |
| VERSION=latest | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| fi | |
| if [ "${{ github.event_name }}" = "schedule" ]; then | |
| VERSION=nightly | |
| fi | |
| echo ::set-output name=version::${VERSION} | |
| - name: Set up docker buildx | |
| id: buildx | |
| uses: crazy-max/ghaction-docker-buildx@v3 | |
| with: | |
| buildx-version: latest | |
| qemu-version: latest | |
| - name: Available platforms | |
| run: echo ${{ steps.buildx.outputs.platforms }} | |
| - name: Login to Aliyun | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: registry.cn-beijing.aliyuncs.com | |
| username: ${{ secrets.ALIYUNCS_USERNAME }} | |
| password: ${{ secrets.ALIYUNCS_PASSWORD }} | |
| - name: Login to Docker | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| # - name: Login to HUAWEICLOUD | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: swr.cn-southwest-2.myhuaweicloud.com | |
| # username: ${{ secrets.HUAWEICLOUD_USERNAME }} | |
| # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} | |
| - name: Build and push Docker images | |
| uses: docker/build-push-action@v3 | |
| with: | |
| tags: | | |
| docker.io/kubesphere/kubectl:${{ steps.prepare.outputs.version }} | |
| registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:${{ steps.prepare.outputs.version }} | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| # - name: Sync images to HUAWEICLOUD | |
| # if: steps.chose_registry.outputs.env == 'prod' | |
| # run: | | |
| # docker pull kubesphere/kubectl:${{ steps.prepare.outputs.version }} | |
| # docker tag kubesphere/kubectl:${{ steps.prepare.outputs.version }} swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/kubectl:${{ steps.prepare.outputs.version }} | |
| # docker push swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/kubectl:${{ steps.prepare.outputs.version }} | |