Skip to content

Update Blockers Meta #3386

Update Blockers Meta

Update Blockers Meta #3386

name: Update Blockers Meta
on:
push:
paths:
- 'blockers/list.json'
- '*.go'
- '.github/workflows/update-blockers.yml'
schedule:
- cron: '0 6 * * *'
- cron: '0 18 * * *'
jobs:
update_blockers:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.19
- uses: actions/checkout@v4
- name: Create local changes
run: |
go build
./main -target blockers
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update blockers meta" blockers.json || exit 0
- 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"