Personal Contacts Sync #984
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: Personal Contacts Sync | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run every day at 2:15am PST (10:15am UTC) | |
- cron: '15 10 * * *' | |
jobs: | |
build: | |
name: Personal Contacts 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_OAUTH_CLIENT_SECRET_JSON: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET_JSON }} | |
GOOGLE_OAUTH_TOKEN_JSON: ${{ secrets.GOOGLE_OAUTH_TOKEN_JSON }} | |
run: | | |
echo "$GOOGLE_OAUTH_CLIENT_SECRET_JSON" > secret-oauth.json | |
echo "$GOOGLE_OAUTH_TOKEN_JSON" > token.json | |
- name: Sync Contacts | |
env: | |
SCMA_USERNAME: ${{ secrets.SCMA_USERNAME }} | |
SCMA_PASSWORD: ${{ secrets.SCMA_PASSWORD }} | |
run: ./scma-gsync users --input web --output gppl --group SCMA --auth-type oauth --secret-file secret-oauth.json --token-file token.json | |