-
Notifications
You must be signed in to change notification settings - Fork 91
100 lines (79 loc) · 2.67 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- master
# Run actions on PRs, but only deploy on master
pull_request:
env:
CARGO_TERM_COLOR: always
RELAY_CARGO_ARGS: "--locked"
jobs:
cargo_docs:
name: Cargo Docs
runs-on: ubuntu-latest
steps:
- name: Install libcurl-dev
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust Toolchain
run: rustup toolchain install stable --profile minimal --component rust-docs --no-self-update
- uses: swatinem/rust-cache@v2
with:
key: ${{ github.job }}
- name: Build Docs
run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: -Dwarnings
- run: echo '<meta http-equiv="refresh" content="0; url=relay/" />Redirecting to <a href="relay/">relay</a>' > target/doc/index.html
- name: Deploy
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
metrics_docs:
name: Metrics Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
run: rustup toolchain install stable --profile minimal --no-self-update
- uses: swatinem/rust-cache@v2
with:
key: ${{ github.job }}
- name: Document Metrics
run: cargo run -p document-metrics -- -o relay_metrics.json
relay-kafka/src/statsd.rs
relay-metrics/src/statsd.rs
relay-server/src/statsd.rs
relay-system/src/statsd.rs
- name: Deploy
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.DATA_SCHEMAS_GITHUB_TOKEN }}
run: |
git config --global user.name "$(git log -1 --pretty=format:%an $GITHUB_SHA)"
git config --global user.email "$(git log -1 --pretty=format:%ae $GITHUB_SHA)"
git clone https://getsentry-bot:$GITHUB_TOKEN@github.com/getsentry/sentry-docs
cd sentry-docs/
mv ../relay_metrics.json src/data/relay_metrics.json
git add src/data/relay_metrics.json
echo "attempting commit"
if ! git commit -m "getsentry/relay@$GITHUB_SHA" ; then
echo "Stopping, no changes"
exit 0
fi
for i in 1 2 3 4 5; do
echo "git push; Attempt $i"
if git push; then
exit 0
fi
git pull --rebase
done
echo "Failed to push"
exit 1