Skip to content

Commit 277281d

Browse files
committed
CI: update publishing workflow.
1 parent 3e738b0 commit 277281d

File tree

2 files changed

+35
-29
lines changed

2 files changed

+35
-29
lines changed

.github/workflows/deploy.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
name: Publish
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out source code
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- name: Install mdbook
15+
run: |
16+
mkdir mdbook
17+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.26/mdbook-v0.4.26-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
18+
echo `pwd`/mdbook >> $GITHUB_PATH
19+
- name: Generate book
20+
run: |
21+
./generate-book.py
22+
# This cannot be safely offered before https://github.com/rust-lang/mdBook/issues/1238 is fixed.
23+
# - if: ${{ github.repository != 'amaranth-lang/rfcs' }}
24+
# name: Publish artifact to gh-pages branch in this repository
25+
# uses: JamesIves/github-pages-deploy-action@releases/v4
26+
# with:
27+
# folder: book/
28+
# branch: ${{ github.repository == 'amaranth-lang/rfcs' && 'pages' || 'gh-pages' }}
29+
# single-commit: true
30+
- if: ${{ github.repository == 'amaranth-lang/rfcs' }}
31+
name: Publish artifact to https://amaranth-lang.org/rfcs/
32+
run: |
33+
set -o pipefail
34+
cd book/
35+
tar c * | zstd -T0 -1 | curl https://amaranth-lang.org/rfcs/ -X PUT -H "Authorization: Pages ${{ secrets.GREBEDOC_TOKEN }}" -H "Content-Type: application/x-tar+zstd" -T -

0 commit comments

Comments
 (0)