-
Notifications
You must be signed in to change notification settings - Fork 206
75 lines (65 loc) · 2.04 KB
/
update-blockers.yml
File metadata and controls
75 lines (65 loc) · 2.04 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Update Blockers Meta
on:
push:
paths:
- '.github/workflows/update-blockers.yml'
- "src/cshub/mkblockers.py"
- "pyproject.toml"
- "uv.lock"
- 'blockers/list.json'
schedule:
- cron: '0 6 * * *'
- cron: '0 18 * * *'
jobs:
update_blockers:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.5.24
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: set up python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: update blockers.json
run: |
uv sync --all-extras --dev --locked
uv run mkblockers
- uses: nelonoel/branch-name@v1.0.1
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update blockers meta" blockers.json || exit 0
git pull --rebase origin ${BRANCH_NAME}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
invalidate-cache:
runs-on: ubuntu-latest
if: |
startsWith('refs/heads/v', github.ref) || github.ref == 'refs/heads/master'
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.CF_AWS_ROLE }}
role-session-name: github-action
aws-region: eu-west-1
- name: Get branch name
run: echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Invalidate cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/${{ env.version }}/blockers.json"