Update Drivers Website #7035
This file contains 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: Update Drivers Website | |
on: | |
workflow_dispatch: | |
# Every two hours | |
schedule: | |
- cron: '0 */2 * * *' | |
jobs: | |
update-drivers-website: | |
runs-on: ubuntu-latest | |
env: | |
S3_DRIVERS_BUCKET: falco-distribution | |
S3_DRIVERS_KEY_PREFIX: driver | |
AWS_S3_REGION: eu-west-1 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout test-infra | |
uses: actions/checkout@v3 | |
- name: Setup Golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.19' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: "arn:aws:iam::292999226676:role/github_actions-test-infra-s3" | |
aws-region: ${{ env.AWS_S3_REGION }} | |
- name: Create output folder | |
run: mkdir /$RUNNER_TEMP/update-drivers-website | |
- name: Setup update-drivers-website helper | |
working-directory: tools/update-drivers-website | |
run: go build -v -o update-drivers-website ./updateDriversWebsite.go | |
- name: Build updated json | |
working-directory: tools/update-drivers-website | |
run: ./update-drivers-website "/$RUNNER_TEMP/update-drivers-website" | |
- name: Copy index.html | |
working-directory: tools/update-drivers-website | |
run: cp index.html /$RUNNER_TEMP/update-drivers-website | |
- name: Push updated files to s3 bucket | |
run: aws s3 cp "/$RUNNER_TEMP/update-drivers-website" s3://${{ env.S3_DRIVERS_BUCKET}}/${{ env.S3_DRIVERS_KEY_PREFIX }}/site --recursive --include "*.json" --include "index.html" --acl public-read |