Skip to content

Shared Calendar Sync #990

Shared Calendar Sync

Shared Calendar Sync #990

name: Shared Calendar Sync
on:
workflow_dispatch:
schedule:
# Run every day at 2:30am PST (10:30am UTC)
- cron: '30 10 * * *'
jobs:
build:
name: Shared Calendar Sync
runs-on: ubuntu-latest
steps:
- name: Download latest release
uses: robinraju/release-downloader@v1.11
with:
repository: rfdonnelly/scma-gsync
latest: true
fileName: scma-gsync-x86_64-unknown-linux-gnu.tar.xz
- name: Extract release
run: |
tar xf scma-gsync-x86_64-unknown-linux-gnu.tar.xz scma-gsync-x86_64-unknown-linux-gnu/scma-gsync
mv scma-gsync-x86_64-unknown-linux-gnu/scma-gsync scma-gsync
- name: Populate credentials
env:
GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
run: |
echo "$GOOGLE_SERVICE_ACCOUNT_JSON" > secret-service-account.json
- name: Sync Events
env:
SCMA_USERNAME: ${{ secrets.SCMA_USERNAME }}
SCMA_PASSWORD: ${{ secrets.SCMA_PASSWORD }}
RUST_BACKTRACE: 1
run: ./scma-gsync events --input web --output gcal --calendar SCMA --auth-type service-account --secret-file secret-service-account.json
- name: Populate email aliases
env:
EMAIL_ALIASES: ${{ secrets.EMAIL_ALIASES }}
run: |
echo "$EMAIL_ALIASES" > email-aliases.yml
cat email-aliases.yml
- name: Sync ACL
env:
SCMA_USERNAME: ${{ secrets.SCMA_USERNAME }}
SCMA_PASSWORD: ${{ secrets.SCMA_PASSWORD }}
RUST_BACKTRACE: 1
run: ./scma-gsync users --input web --output gcal --calendar SCMA --email-aliases-file email-aliases.yml --auth-type service-account --secret-file secret-service-account.json --notify-acl-insert true