This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 4
144 lines (125 loc) · 4.35 KB
/
pages.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
# Before changing any of these workflow triggers, make sure you understand the if statements for each of the jobs
on:
# Run automatically after the Android CI release finishes
workflow_run:
workflows:
- Android CI
branches:
- master
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Run on pull requests to master
pull_request:
# Note that this specifies the target branch, not the branch that the PR is from
branches:
- master
jobs:
build:
# Run if the Android CI build was successful, on PRs from docs/ branches, or if this is a manual workflow run
if: ${{ github.event.workflow_run.conclusion == 'success' || startsWith(github.head_ref, 'docs/') || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build website
run: ./build.sh
working-directory: ./HelpPage/scripts/
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle
- name: Build JavaDoc using Dokka
run: |
./gradlew :TeamCode:dokkaHtml --no-daemon
mv ./TeamCode/build/dokka/html ./HelpPage/build/javadoc
- name: Upload Pages build artifact
uses: actions/upload-pages-artifact@v2
with:
name: github-pages-build
path: ./HelpPage/build
retention-days: 90
deploy:
# Only run deployment from the master branch and not on pull requests
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
needs:
- build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Only allow one concurrent deployment
concurrency:
group: pages-deploy
cancel-in-progress: false
steps:
- name: Configure Pages
uses: actions/configure-pages@v3
- name: Download Pages build artifact
uses: actions/download-artifact@v3
with:
name: github-pages-build
- name: Extract Pages build artifact
run: |
mkdir pages-build
tar -xvf artifact.tar -C pages-build
- name: Download the latest APK
run: |
mkdir -p ./pages-build/apk/bin
cd ./pages-build/apk/bin
curl -LO https://github.com/XaverianTeamRobotics/FtcRobotController/releases/download/latest-ci-build/TeamCode-debug.apk
- name: Upload final Pages artifact
uses: actions/upload-pages-artifact@v2
with:
name: github-pages-deploy
path: ./pages-build
retention-days: 90
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
artifact_name: github-pages-deploy
test-deploy:
needs:
- build
runs-on: ubuntu-latest
# Only allow one concurrent test deployment per branch
concurrency:
group: pages-test-deploy-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Download Pages build artifact
uses: actions/download-artifact@v3
with:
name: github-pages-build
- name: Extract Pages build artifact
run: |
mkdir pages-build
tar -xvf artifact.tar -C pages-build
- name: Upload build to Cloudflare Pages
id: test-deployment
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: xbhs-robotics-docs
directory: pages-build
- name: Add comment with test deployment URL
if: ${{ github.event_name == 'pull_request' }}
run: >
gh pr comment ${{ github.event.number }}
--repo ${{ github.repository }}
--body "Your docs changes were built successfully!
View a preview of them at ${{ steps.test-deployment.outputs.url }}"
env:
GH_TOKEN: ${{ github.token }}