Skip to content

chore: update ref to docs (🤖) (#926) #2700

chore: update ref to docs (🤖) (#926)

chore: update ref to docs (🤖) (#926) #2700

Workflow file for this run

name: Push and publish main
on:
schedule:
# twice a day at midnight and noon UTC
- cron: '0 0,12 * * *'
push:
branches:
- main
workflow_dispatch:
concurrency: publish
jobs:
# Make a reusable workflow
crowdin-upload:
if: github.repository == 'electron/website'
name: Upload to Crowdin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag: v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # tag: v6.0.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Upload sources to Crowdin
run: 'yarn i18n:upload'
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
build-and-deploy:
if: github.repository == 'electron/website'
name: Build and deploy the website
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Set GIT_BRANCH
run: echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Print GIT_BRANCH
run: echo $GIT_BRANCH
- name: Print content
run: ls -ln
# This should be set up from earlier
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag: v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # tag: v6.0.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Lint
run: yarn lint
env:
CI: true
- name: Docusaurus Cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # tag: v4.3.0
with:
path: |
${{ github.workspace }}/.docusaurus
${{ github.workspace }}/**/.cache
key: |
${{ runner.os }}-docusaurus-v2-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-docusaurus-v2-${{ hashFiles('**/yarn.lock') }}
- name: Add Docusaurus problem matcher
run: echo "::add-matcher::.github/problem-matchers/docusaurus.json"
- name: Build default locale site
run: yarn build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sync build directory to Azure Blob Storage
uses: nick-invision/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # tag: v3.0.2
with:
timeout_seconds: 3000
max_attempts: 3
retry_on: error
# Ensure that we upload the default locale and remove deleted files but don't touch translations
command: cd ./build && ../scripts/bin/azcopy sync "./" "https://electronwebsite.blob.core.windows.net/%24web/?$SAS" --exclude-path="de/;es/;fr/;ja/;pt/;ru/;zh/;" --compare-hash=MD5
env:
SAS: ${{ secrets.SAS }}
- name: Upload azcopy debug logs
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0
with:
name: debug-log
path: /home/runner/.azcopy/*.log
include-hidden-files: true
retention-days: 3