-
Notifications
You must be signed in to change notification settings - Fork 2
143 lines (122 loc) · 4.37 KB
/
Copy pathdocs.yml
File metadata and controls
143 lines (122 loc) · 4.37 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
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Docs
on:
push:
pull_request:
workflow_dispatch:
env:
RUST_TOOLCHAIN_VERSION: stable
jobs:
build:
name: Build Docs
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
with:
toolchain: "${{ env.RUST_TOOLCHAIN_VERSION }}"
- name: Cache Rust packages
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
env-vars: "RUST_TOOLCHAIN_VERSION"
workspaces: |
native/arrow_format_nif
- name: Install Erlang/OTP
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
otp-version: 25.1.0
rebar3-version: '3.18.0'
- name: Cache Hex packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-hex-
- name: Generate docs
run: rebar3 ex_doc
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
name: docs-${{ github.sha }}
path: 'doc'
deploy_fork:
name: Deploy to GitHub Pages on fork
if: >-
(github.event_name == 'push' ||
github.event_name == 'workflow_dispatch') &&
github.repository != 'apache/arrow-erlang'
needs: build
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
with:
artifact_name: docs-${{ github.sha }}
asf_site:
# Only deploy on a push to main
if: github.ref_name == 'main' && github.event_name == 'push' && github.repository == 'apache/arrow-erlang'
name: Deploy to arrow.apache.org
needs: build
permissions:
contents: write
# Allow only one concurrent deployment
concurrency:
group: "asf_site"
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: docs-${{ github.sha }}
path: docs
- name: Prepare website
run: |
mkdir -p asf-site/main
tar -xf docs/artifact.tar -C asf-site/main
cp .asf.yaml asf-site
cp .htaccess asf-site
- name: Deploy to ASF
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: asf-site
publish_branch: asf-site
# Avoid accumulating history of in progress API jobs: https://github.com/apache/arrow-rs/issues/5908
force_orphan: true