BetaCat0 pushed module-controller code #6
Workflow file for this run
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: Module Controller Dev With Remote Debug Enabled | |
| run-name: ${{ github.actor }} pushed module-controller code | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| env: | |
| CGO_ENABLED: 0 | |
| GO_VERSION: 1.22.4 | |
| GOOS: linux | |
| WORK_DIR: . | |
| DOCKERHUB_REGISTRY: serverless-registry.cn-shanghai.cr.aliyuncs.com | |
| MODULE_CONTROLLER_IMAGE_PATH: opensource/test/module-controller-v2 | |
| DOCKER_GITHUB_REGISTRY: ghcr.io | |
| DOCKER_GITHUB_IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-push-linux-amd64-image: | |
| name: "Build and push module-controller Docker images" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ${{ env.DOCKERHUB_REGISTRY }} | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.DOCKER_GITHUB_REGISTRY }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get the version | |
| id: get_version | |
| run: | | |
| if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then | |
| echo ::set-output name=VERSION::latest | |
| else | |
| echo ::set-output name=VERSION::${GITHUB_REF#refs/*/} | |
| fi | |
| - name: Build and push module-controller Docker images | |
| uses: docker/[email protected] | |
| with: | |
| context: ${{ env.WORK_DIR }} | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache | |
| file: ${{ env.WORK_DIR }}/debug.Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ${{ env.DOCKERHUB_REGISTRY }}/${{ env.MODULE_CONTROLLER_IMAGE_PATH }}:${{ steps.get_version.outputs.VERSION }} | |
| ${{ env.DOCKER_GITHUB_REGISTRY }}/${{ env.DOCKER_GITHUB_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }} |