integration-cleanup #16741
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: integration-cleanup | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 * * * *" | |
| permissions: | |
| id-token: write # Required for obtaining AWS OIDC federated credential. | |
| jobs: | |
| gcp: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./tools/reaper | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| repository: fluxcd/test-infra | |
| - name: Setup Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: 1.25.x | |
| cache-dependency-path: ./tools/reaper/go.sum | |
| - name: Setup bin dir | |
| run: mkdir -p ~/.local/bin | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0 | |
| with: | |
| credentials_json: '${{ secrets.CLEANUP_E2E_GOOGLE_CREDENTIALS }}' | |
| - name: Setup gcloud | |
| uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1 | |
| - name: Run reaper | |
| run: go run ./ -provider gcp -gcpproject ${{ vars.TF_VAR_gcp_project_id }} -retention-period 1h -tags 'ci=true' -delete | |
| azure: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./tools/reaper | |
| if: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| repository: fluxcd/test-infra | |
| - name: Setup Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: 1.25.x | |
| cache-dependency-path: ./tools/reaper/go.sum | |
| - name: Authenticate to Azure | |
| uses: Azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v1.4.6 | |
| with: | |
| creds: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}","clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.ARM_TENANT_ID }}"}' | |
| - name: Run reaper | |
| run: go run ./ -provider azure -retention-period 1h -tags 'ci=true' -delete | |
| aws: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./tools/reaper | |
| if: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| repository: fluxcd/test-infra | |
| - name: Setup Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: 1.25.x | |
| cache-dependency-path: ./tools/reaper/go.sum | |
| - name: Authenticate to AWS | |
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.CLEANUP_E2E_AWS_ASSUME_ROLE_NAME }} | |
| role-session-name: cleanup_GH_Actions | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Run reaper | |
| run: go run ./ -provider aws-nuke -awsregions '${{ vars.AWS_REGION }},${{ vars.OCI_E2E_TF_VAR_cross_region }}' -retention-period 1h -tags 'ci=true' -delete |