-
Notifications
You must be signed in to change notification settings - Fork 136
78 lines (74 loc) · 2.66 KB
/
push-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Push and publish main
on:
schedule:
# twice a day at midnight and noon
- cron: '0 0,12 * * *'
push:
branches:
- main
workflow_dispatch:
concurrency: publish
jobs:
# Make a reusable workflow
crowdin-upload:
name: Upload to Crowdin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # tag: v4.1.0
with:
node-version: 20
- name: Install dependencies
uses: bahmutov/npm-install@438a933ce1059e4e2b39e3d2a42c5067070dd444 # tag: v1.10.4
- name: Upload sources to Crowdin
run: 'yarn i18n:upload'
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
build-and-deploy:
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@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # tag: v4.1.0
with:
node-version: 20
- name: Install dependencies
uses: bahmutov/npm-install@438a933ce1059e4e2b39e3d2a42c5067070dd444 # tag: v1.10.4
- name: Lint
run: yarn lint
env:
CI: true
- name: Docusaurus Cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # tag: v4.2.0
with:
path: |
${{ github.workspace }}/.docusaurus
${{ github.workspace }}/**/.cache
key: |
${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-docusaurus-${{ 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: Publish everything to Storage
uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e # tag: v3.0.0
with:
timeout_seconds: 300
max_attempts: 3
retry_on: error
command: ./scripts/bin/azcopy copy "./build/*" "https://electronwebsite.blob.core.windows.net/%24web/?$SAS" --recursive
env:
SAS: ${{ secrets.SAS }}