Repository navigation
57 lines (49 loc) · 1.87 KB
/
Copy pathmorrowbyte-sync.yml
File metadata and controls
57 lines (49 loc) · 1.87 KB
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
name: Morrowbyte upstream nightly sync
on:
schedule:
- cron: "37 */6 * * *"
workflow_dispatch:
concurrency:
group: morrowbyte-upstream-sync
cancel-in-progress: false
permissions:
actions: write
contents: write
issues: write
jobs:
sync:
if: github.repository == 'morrowbyte/t3code' && vars.MORROWBYTE_UPSTREAM_SYNC == 'true'
runs-on: [self-hosted, "${{ vars.MORROWBYTE_LINUX_RUNNER || 'morrowbyte-linux' }}"]
timeout-minutes: 35
steps:
- name: Require workflow-capable upstream sync token
env:
MORROWBYTE_UPSTREAM_TOKEN: ${{ secrets[vars.MORROWBYTE_UPSTREAM_TOKEN_SECRET_NAME || 'MORROWBYTE_UPSTREAM_TOKEN'] }}
run: |
set -euo pipefail
test "$GITHUB_REPOSITORY" = morrowbyte/t3code
if [[ -z "$MORROWBYTE_UPSTREAM_TOKEN" ]]; then
echo "Repository Actions secret MORROWBYTE_UPSTREAM_TOKEN is required for sync checkout, GitHub API calls, and fast-forward promotion." >&2
exit 1
fi
- name: Checkout fork main
uses: actions/checkout@v4
with:
repository: morrowbyte/t3code
ref: main
fetch-depth: 0
token: ${{ secrets[vars.MORROWBYTE_UPSTREAM_TOKEN_SECRET_NAME || 'MORROWBYTE_UPSTREAM_TOKEN'] }}
- name: Configure upstream remote
run: git remote add upstream https://github.com/pingdotgg/t3code.git
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: package.json
cache: true
run-install: false
- name: Sync, validate, and promote latest published nightly
env:
GH_TOKEN: ${{ secrets[vars.MORROWBYTE_UPSTREAM_TOKEN_SECRET_NAME || 'MORROWBYTE_UPSTREAM_TOKEN'] }}
run: |
set -euo pipefail
bash scripts/morrowbyte/sync-upstream-nightly.sh