-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (47 loc) · 1.29 KB
/
gc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: garbage collection
on:
workflow_call:
inputs:
dry_run:
default: true
type: boolean
workflow_dispatch:
inputs:
dry_run:
default: true
type: boolean
schedule:
# Run every Monday at 1pm UTC / 8am ET
- cron: "0 13 * * 1"
permissions:
id-token: write
contents: read
concurrency:
# keep `gc-` prefix to avoid collisions with other workflows
# when used with `workflow_call` event
group: "gc-${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
working-directory: ./gc
jobs:
gc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.VM_IMAGES_AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install requirements
run: pip install -r requirements.txt
- name: Check mypy
run: mypy main.py collectors/*.py
- name: Check black
run: black --check main.py collectors/*.py
- name: Run garbage collection
run: python main.py --dry-run="${DRY_RUN}"
env:
DRY_RUN: ${{ github.event_name == 'schedule' && 'false' || inputs.dry_run }}