Skip to content

Commit

Permalink
ci: ensure docker buildx removes the running nodes (#448)
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <[email protected]>
  • Loading branch information
davidspek authored Sep 12, 2023
1 parent de457f9 commit 23ae1e8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
Expand All @@ -43,8 +43,9 @@ jobs:
type=ref,event=branch
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
cleanup: true
driver: kubernetes
platforms: linux/amd64
driver-opts: |
Expand Down Expand Up @@ -107,12 +108,18 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
if: always()
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
role-session-name: PluralCLI
- name: Manually cleanup buildx
if: always()
run: |
docker buildx stop ${{ steps.builder.outputs.name }}
sleep 10
docker buildx rm ${{ steps.builder.outputs.name }}
cloud:
name: Build cloud image
runs-on: ubuntu-latest
Expand All @@ -126,7 +133,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
Expand All @@ -149,8 +156,9 @@ jobs:
type=ref,event=branch
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
cleanup: true
driver: kubernetes
platforms: linux/amd64
driver-opts: |
Expand Down Expand Up @@ -214,12 +222,18 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
if: always()
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
role-session-name: PluralCLI
- name: Manually cleanup buildx
if: always()
run: |
docker buildx stop ${{ steps.builder.outputs.name }}
sleep 10
docker buildx rm ${{ steps.builder.outputs.name }}
dind:
name: Build dind image
runs-on: ubuntu-latest
Expand All @@ -233,7 +247,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
Expand All @@ -256,8 +270,9 @@ jobs:
type=ref,event=branch
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
cleanup: true
driver: kubernetes
platforms: linux/amd64
driver-opts: |
Expand Down Expand Up @@ -321,12 +336,18 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
if: always()
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
role-session-name: PluralCLI
- name: Manually cleanup buildx
if: always()
run: |
docker buildx stop ${{ steps.builder.outputs.name }}
sleep 10
docker buildx rm ${{ steps.builder.outputs.name }}
trivy-scan:
name: Trivy fs scan
runs-on: ubuntu-latest
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/goreleaser-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
Expand All @@ -156,8 +156,9 @@ jobs:
type=semver,pattern={{version}}
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
cleanup: true
driver: kubernetes
platforms: linux/amd64
driver-opts: |
Expand Down Expand Up @@ -234,12 +235,18 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
if: always()
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::312272277431:role/github-actions/buildx-deployments
role-session-name: PluralCLI
- name: Manually cleanup buildx
if: always()
run: |
docker buildx stop ${{ steps.builder.outputs.name }}
sleep 10
docker buildx rm ${{ steps.builder.outputs.name }}
packer:
name: Build EKS AMI
runs-on: ubuntu-latest
Expand All @@ -251,7 +258,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::654897662046:role/github-actions/plural-cli-amis-packer
Expand Down

0 comments on commit 23ae1e8

Please sign in to comment.