-
Notifications
You must be signed in to change notification settings - Fork 17
105 lines (92 loc) · 3.31 KB
/
Copy pathci.yml
File metadata and controls
105 lines (92 loc) · 3.31 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: The Trial of Truth aka CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- master
permissions:
contents: read
jobs:
files-changed:
if: github.event.pull_request.draft == false
name: The Watchful Eye (Files Changed)
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
outputs:
api_source: ${{ steps.changes.outputs.api_source }}
client_source: ${{ steps.changes.outputs.client_source }}
workflows: ${{ steps.changes.outputs.workflows }}
steps:
- name: The Oracle's Gaze aka Checkout Code
uses: actions/checkout@v4
- name: The Seer's Vision aka Filter Paths
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
api_source:
- 'projects/api/src/**'
- 'projects/api/deno.json'
openapi:
- 'projects/openapi/*'
openapi:
needs: files-changed
name: The Scribe's Chamber (OpenAPI)
runs-on: ubuntu-latest
steps:
- name: Summoning the Ancient Scrolls aka Checkout Code
uses: actions/checkout@v4
- name: The Oracle's Gaze aka Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.3.0
- name: The Sacred Assembly aka Install Dependencies
run: 'deno task install'
- name: The Scroll's Scrutiny aka Validate OpenAPI
if: ${{
needs.files-changed.outputs.api_source == 'true' ||
needs.files-changed.outputs.openapi == 'true'
}}
run: deno task openapi:validate
- name: The Sacred Transcription aka Generate OpenAPI
if: github.ref == 'refs/heads/master'
run: deno task openapi:generate
- name: Preserving the Sacred Texts aka Upload Definition
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: openapi
path: projects/openapi/openapi.json
if-no-files-found: error
retention-days: 30
- name: The Sacred Transcription aka Upload to Readme
if: github.ref == 'refs/heads/master'
uses: readmeio/rdme@v10
with:
rdme: openapi upload ./projects/openapi/openapi.json --key=${{ secrets.README_API_KEY }} --slug=openapi.json
- name: Summoning the GitHub App Token
if: github.ref == 'refs/heads/master'
uses: actions/create-github-app-token@v2
id: generate-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
repositories: trakt-android
- name: The Sacred Scroll's Journey aka Push OpenAPI to Android Repo
if: github.ref == 'refs/heads/master'
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ steps.generate-token.outputs.token }}
with:
source_file: 'projects/openapi/openapi.json'
destination_repo: 'trakt/trakt-android'
destination_folder: 'openapi'
user_email: 'github-actions[bot]@users.noreply.github.com'
user_name: 'github-actions[bot]'
commit_message: 'chore: openapi schema updates'
destination_branch_create: 'feat/openapi_ci'