From 7af9bac11e2ba88f1ef2b91d5b098f55a642c625 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 9 Jan 2025 16:25:05 +0100 Subject: [PATCH] Update ecr image pusher to also use chef docker image --- .../workflows/build-debug-docker-release.yaml | 71 ------------------- .../build-debug-docker-with-chef.yaml | 2 +- .../build-main-debug-docker-container.yaml | 69 ------------------ .github/workflows/docker_ecr_arch64.yaml | 6 +- 4 files changed, 6 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/build-debug-docker-release.yaml delete mode 100644 .github/workflows/build-main-debug-docker-container.yaml diff --git a/.github/workflows/build-debug-docker-release.yaml b/.github/workflows/build-debug-docker-release.yaml deleted file mode 100644 index c10c8448..00000000 --- a/.github/workflows/build-debug-docker-release.yaml +++ /dev/null @@ -1,71 +0,0 @@ ---- -name: Build Release - docker debug image for Github container registry -on: - workflow_dispatch: - push: - paths: - - "**/*.rs" - - "**/*.toml" - - ".github/workflows/build-debug-docker-release.yaml" - tags: - - unleash-edge-v[0-9]+.* - -permissions: - id-token: write - contents: read - packages: write - -jobs: - dockerpublish: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install rust - run: | - rustup set auto-self-update disable - rustup toolchain install stable --profile default - rustup show - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - prefix-key: "rust-v0-gnu" - - name: Install cross (cross compile) - run: | - cargo install cross - - name: Build release for x86_64 - run: | - cargo build --release --target=x86_64-unknown-linux-gnu - - name: Build release for aarch64 - run: | - cross build --release --target=aarch64-unknown-linux-gnu - - name: Setup docker buildx - uses: docker/setup-buildx-action@v3 - - name: Docker meta configuration (set image and tag) - uses: docker/metadata-action@v5 - id: meta - with: - images: | - ghcr.io/Unleash/unleash-edge-debug - tags: | - type=match,pattern=unleash-edge-v(\d+\.\d+.\d+),group=1,prefix=v - type=match,pattern=unleash-edge-v(\d+\.\d+).*,group=1,prefix=v - - - name: Login to Github Container registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build tag and push images - uses: docker/build-push-action@v6 - with: - file: Dockerfile.debug - context: . - platforms: linux/arm64,linux/amd64 - push: true - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/build-debug-docker-with-chef.yaml b/.github/workflows/build-debug-docker-with-chef.yaml index 0e667e8d..98a364f4 100644 --- a/.github/workflows/build-debug-docker-with-chef.yaml +++ b/.github/workflows/build-debug-docker-with-chef.yaml @@ -1,4 +1,4 @@ -name: Build and Push Docker Image (Chef) +name: Build and Push Debug Docker Image (Chef) concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/build-main-debug-docker-container.yaml b/.github/workflows/build-main-debug-docker-container.yaml deleted file mode 100644 index 5421551e..00000000 --- a/.github/workflows/build-main-debug-docker-container.yaml +++ /dev/null @@ -1,69 +0,0 @@ ---- -name: Build main - debug docker image for Github Container registry -on: - workflow_dispatch: - push: - branches: - - main - paths: - - "**/*.rs" - - "**/*.toml" - - ".github/workflows/build-main-debug-docker-container.yaml" - -permissions: - id-token: write - contents: read - packages: write - -jobs: - dockerpublish: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install rust - run: | - rustup set auto-self-update disable - rustup toolchain install stable --profile default - rustup show - - name: Rust cache - uses: Swatinem/rust-cache@v2 - with: - prefix-key: "rust-v0-gnu" - - name: Install cross (cross compile) - run: | - cargo install cross - - name: Build release for x86_64 - run: | - cargo build --release --target=x86_64-unknown-linux-gnu - - name: Build release for aarch64 - run: | - cross build --release --target=aarch64-unknown-linux-gnu - - name: Setup docker buildx - uses: docker/setup-buildx-action@v3 - - name: Docker meta configuration (set image and tag) - uses: docker/metadata-action@v5 - id: meta - with: - images: | - ghcr.io/unleash/unleash-edge-debug - tags: | - type=edge - - name: Login to Github Container registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build tag and push images - uses: docker/build-push-action@v6 - with: - file: Dockerfile.debug - context: . - platforms: linux/arm64,linux/amd64 - push: true - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/docker_ecr_arch64.yaml b/.github/workflows/docker_ecr_arch64.yaml index 6ecf252a..f92b65f3 100644 --- a/.github/workflows/docker_ecr_arch64.yaml +++ b/.github/workflows/docker_ecr_arch64.yaml @@ -11,6 +11,7 @@ on: - ".github/workflows/docker_ecr_arch64.yaml" tags: - unleash-edge-v[0-9]+.* + workflow_dispatch: permissions: id-token: write contents: read @@ -22,6 +23,7 @@ jobs: uses: actions/checkout@v4 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 + if: github.event_name != 'pull_request' with: role-to-assume: arn:aws:iam::726824350591:role/unleash-github-ecr-private-publish-role role-session-name: actions-push-to-ecr-private @@ -29,6 +31,7 @@ jobs: - name: Login to ECR id: login-ecr-eu-north uses: aws-actions/amazon-ecr-login@v2 + if: github.event_name != 'pull_request' - name: Setup docker buildx uses: docker/setup-buildx-action@v3 - name: Docker meta configuration (set image and tag) @@ -47,11 +50,12 @@ jobs: with: context: . platforms: linux/arm64 - push: true + push: ${{ github.event_name != 'pull_request' }} labels: ${{ steps.meta.outputs.labels }} tags: ${{ steps.meta.outputs.tags }} notifypipeline: runs-on: ubuntu-latest + if: github.event_name != 'pull_request' timeout-minutes: 5 needs: docker steps: