Skip to content

Notion->Crowdin->Publish #183

Notion->Crowdin->Publish

Notion->Crowdin->Publish #183

Workflow file for this run

name: Notion->Crowdin->Publish
on:
push:
branches:
- master
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: yarn install
# for some reason it was telling me my lockfile was out of date run: yarn install --frozen-lockfile
- name: Pull from Notion
env:
SIL_BLOOM_DOCS_NOTION_TOKEN: ${{ secrets.SIL_BLOOM_DOCS_NOTION_TOKEN }}
SIL_BLOOM_DOCS_NOTION_ROOT_PAGE: ${{ secrets.SIL_BLOOM_DOCS_NOTION_ROOT_PAGE }}
run: yarn pull
- name: copy-static-docs
run: yarn copy-static-docs
# Still doing this here in the sequence for now. See comments below about what needs to happen eventually.
- name: Prepare PDF Download
run: yarn make-pdf
- name: Commit New Source Material
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: GHAction - Commit content changes pulled from notion
- name: Crowdin
run: yarn crowdin:sync
env:
SIL_BLOOM_DOCS_CROWDIN_TOKEN: ${{ secrets.SIL_BLOOM_DOCS_CROWDIN_TOKEN }}
- name: Commit New Translations
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: GHAction - Commit incoming translations from Crowdin
- name: Build Docusaurus instance
run: yarn build
- name: Upload S3
# We exclude these six paths because they existed before the current system.
# Those six index.html files are redirects to other documents, some on docs.bloomlibrary.org, but still (June 2023) some legacy Google docs.
# See more detailed notes at https://docs.google.com/document/d/1Vub0SeQL6BQqyGoQBN6-cfi6AIRbcBHeV87KjnzZXDU/edit#heading=h.aaxpksot3akz.
run: aws s3 sync ./build s3://${{ secrets.AWS_BUCKET }} --delete --exclude "sil-corporate-guidelines/index.html" --exclude "bloomPUB-bundles/index.html" --exclude "bloom-reader-distribution-tags/index.html" --exclude "bloom-reader-shelves/index.html" --exclude "team-collections-sharing-services/index.html" --exclude "team-collections/index.html" --exclude "widgets/index.html"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
# Ultimately, we need to figure out how to make this work.
# But I haven't gotten it working yet. Docusaurus adds a hash to the end of the filename, so it needs to be there when docusaurus
# runs, then we need to use that filename for the real one we generate.
# Make and upload the PDF after uploading to S3 since the PDF is created from content on S3.
# - name: Prepare PDF Download
# run: yarn make-pdf
# - name: Upload PDFs to S3
# run: aws s3 cp ./build/downloads/ s3://${{ secrets.AWS_BUCKET }}/downloads/ --recursive --exclude "*" --include "*.pdf" --exclude "*/*"
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: "us-east-1"