forked from apple/pkl-package-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (70 loc) · 1.99 KB
/
main.yml
File metadata and controls
71 lines (70 loc) · 1.99 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
# Do not modify!
# This file was generated from a template using https://github.com/StefMa/pkl-gha
name: Build (main)
'on':
push:
branches:
- main
tags-ignore:
- '**'
workflow_dispatch:
inputs:
source_run:
description: The source GitHub Action workflow run triggering this build
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
build-and-publish-docs:
name: Generate and publish docs
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Triggered by
if: inputs.source_run != null
run: 'echo "Triggered by workflow in repo: ${{ inputs.source_run }}" >> $GITHUB_STEP_SUMMARY'
- uses: actions/checkout@v5
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: temurin
cache: gradle
- uses: actions/checkout@v5
with:
persist-credentials: true
fetch-depth: 0
- name: Generate and publish docs
env:
GH_TOKEN: ${{ github.token }}
run: ./gradlew check generateAndPublishDocs --refresh-dependencies
trigger-downstream-builds:
if: github.repository_owner == 'apple'
needs:
- build-and-publish-docs
runs-on: ubuntu-latest
steps:
- name: Create app token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.PKL_CI_CLIENT_ID }}
private-key: ${{ secrets.PKL_CI }}
owner: ${{ github.repository_owner }}
- name: Trigger pkl-lang.org build
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |-
gh workflow run \
--repo apple/pkl-lang.org \
--ref main \
--field source_run="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
main.yml