Merge branch 'master' into 25636-deep-dive-webstudio-integration #355
Workflow file for this run
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: CI | |
# Controls when the action will run. Triggers the workflow on push | |
# events but only for the master branch | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest # The type of runner that the job will run on | |
env: | |
SOURCE_EDITOR_URL: ${{ secrets.SOURCE_EDITOR_URL }} | |
steps: # Steps represent a sequence of tasks that will be executed as part of the job | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- run: bash ./.github/scripts/get-plugins-docs.sh | |
- run: pip install -r requirements.txt | |
- run: mkdocs build | |
- run: mkdir public | |
- run: mv ./site ./public/docs | |
- name: Cloudflare | |
if: github.ref == 'refs/heads/master' # Run only for the master branch | |
run: | | |
npm install -g wrangler | |
# wrangler init --site cms-docs | |
sed -i '1i name = "cms-docs"' wrangler.toml | |
sed -i 's+account_id = '\'\''+account_id = '"'"$ACCOUNT_ID"'"'+g' wrangler.toml | |
sed -i 's+bucket = ""+bucket = "./public"+g' wrangler.toml | |
sed -i 's+workers_dev = true++g' wrangler.toml | |
echo "[env.production]" >> wrangler.toml | |
echo "route = 'flotiq.com/docs/*'" >> wrangler.toml | |
mkdir -p /home/runner/.wrangler/config/ | |
echo api_token = '"'"$API_TOKEN"'"' > /home/runner/.wrangler/config/default.toml | |
cat wrangler.toml | |
cd workers-site | |
npm install | |
cd ../ | |
wrangler deploy --env=production | |
# Refresh sitemap in Google and Bing | |
curl "https://www.google.com/webmasters/sitemaps/ping?sitemap=https://flotiq.com/docs/sitemap.xml" | |
curl "https://www.bing.com/webmaster/ping.aspx?siteMap=https://flotiq.com/docs/sitemap.xml" | |
shell: bash | |
env: | |
API_TOKEN: ${{ secrets.API_TOKEN }} | |
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.API_TOKEN }} |