-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.44 KB
/
update-api.yml
File metadata and controls
90 lines (74 loc) · 2.44 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Update API
on:
schedule:
- cron: "0 3 * * 1"
- cron: "0 3 * * 4"
- cron: "0 3 * * 6"
workflow_dispatch:
jobs:
update-api:
name: Update API
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.CI_PAT }}
- name: Checkout lichess-org/api
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: lichess-org/api
ref: master
path: lichess-api
fetch-depth: 1
- name: Copy files
run: |
rm -rf specs/*
mkdir -p specs/schemas specs/tags
cp -r lichess-api/doc/specs/schemas/. specs/schemas/
cp -r lichess-api/doc/specs/tags/. specs/tags/
cp lichess-api/doc/specs/lichess-api.yaml specs/lichess-api.yaml
rm -rf lichess-api
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: ".bun-version"
- name: Install dependencies
run: bun ci
- name: Generate files
run: bun run gen
- name: Build
run: bun run build
- name: Typecheck code
run: bun run typecheck
- name: Run tests
run: bun run test
- name: Create or update Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.CI_PAT }}
commit-message: "ci: update api"
title: "ci: update api"
committer: CI <ci@rman.dev>
author: CI <ci@rman.dev>
body: Update API
branch: update-api
delete-branch: true
assignees: gameroman
reviewers: gameroman
labels: ci
- name: Notify Discord
if: always()
uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
title: "Update API (#${{ github.run_number }})"
description: |
Status: **${{ job.status }}**
Branch: ${{ github.ref_name }}
Trigger: ${{ github.event_name }}
Commit: ${{ github.sha }}