Refresh ICS #1364
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 ICS | |
on: | |
schedule: | |
# Run at 12:00am CST every day | |
- cron: "0 6 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
refresh: | |
runs-on: ubuntu-latest | |
environment: Deployment | |
steps: | |
# Checkout master | |
- uses: actions/checkout@v2 | |
# Setup node | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
npm install | |
# Run typescript compiler | |
- name: Compile Typescript | |
run: | | |
npm run build | |
# Setup gcloud | |
- uses: google-github-actions/setup-gcloud@v0 | |
with: | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
export_default_credentials: true | |
# Run the ics script and output resulting ics to output dir | |
- name: Build ICS file | |
env: | |
EVENT_SPREADSHEET_ID: ${{ secrets.EVENT_SPREADSHEET_ID }} | |
run: | | |
mkdir output | |
node build/index.js > output/calendar.ics | |
# This script now runs as part of the leadership site repo --> https://github.com/acmutd/leadership | |
# Run the birthday script and send slack messages | |
# - name: Run Birthday Script | |
# env: | |
# BIRTHDAY_SPREADSHEET_ID: ${{ secrets.BIRTHDAY_SPREADSHEET_ID }} | |
# SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | |
# run: | | |
# npm run birthday | |
# Abuse this action intended for deploying a gh-pages site to instead push | |
# the ics file to its own branch | |
- name: Deploy ICS file | |
uses: JamesIves/[email protected] | |
with: | |
branch: ics | |
folder: output | |
commit-message: Updating calendar.ics | |
git-config-name: github-actions[bot] | |
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com |