Refresh GitHub Contribution Data #470
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: Refresh GitHub Contribution Data | |
on: | |
workflow_dispatch: | |
schedule: | |
# (see https://crontab.guru) -> “At 07:00 AM UTC every day.” | |
- cron: '0 7 * * *' | |
env: | |
AWS_ACCOUNT_ID: 590184101838 | |
AWS_REGION: us-east-1 | |
AWS_APP: stevezelek-com | |
NODE_VERSION: 16 | |
jobs: | |
refresh_github: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache NPM | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install | |
run: npm ci | |
- name: Reload data | |
run: node github.mjs | |
env: | |
CONTRIBUTION_HISTORY_TOKEN: ${{ secrets.CONTRIBUTION_HISTORY_TOKEN }} | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/${{ env.AWS_APP }}-github-role | |
aws-region: ${{ env.AWS_REGION }} | |
mask-aws-account-id: 'no' | |
- name: Deploy Contribution File | |
run: | | |
aws s3 cp github.json s3://${{ env.AWS_APP }}/files/github.json --content-type "application/json; charset=utf-8" |