-
Notifications
You must be signed in to change notification settings - Fork 402
101 lines (88 loc) · 3.03 KB
/
publish.yml
File metadata and controls
101 lines (88 loc) · 3.03 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
name: Publish to GitHub Pages
on:
push:
branches: ["gh-pages"]
workflow_dispatch:
schedule:
# Run Daily at 9:00 AM UTC
# Pick up updates to crawled Features
- cron: '0 9 * * *'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Oras
run: |
curl -LO https://github.com/oras-project/oras/releases/download/v0.13.0/oras_0.13.0_linux_amd64.tar.gz
mkdir -p oras-install/
tar -zxf oras_0.13.0_*.tar.gz -C oras-install/
mv oras-install/oras /usr/local/bin/
rm -rf oras_0.13.0_*.tar.gz oras-install/
- name: Fetch devcontainer-control-manifest.json
run: |
cd _data
oras pull ghcr.io/devcontainers/control-manifest:latest
cp devcontainer-control-manifest.json ../static/
- name: Fetch devcontainer-index.json
run: |
cd _data
oras pull ghcr.io/devcontainers/index:latest
cp devcontainer-index.json ../static/
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Copy raw markdown files to output directory
run: |
rsync -a \
--exclude='/README.md' \
--exclude='/SECURITY.md' \
--exclude='/CODEOWNERS' \
--exclude='/contributing.md' \
--include='/*.md' \
--exclude='/*' \
./ _site/
rsync -am --include='*/' --include='*.md' --exclude='*' _implementors/ _site/implementors/
for f in _posts/*.md; do
[ -e "$f" ] || continue
filename=$(basename "$f")
cp "$f" "_site/guide/${filename#????-??-??-}"
done
- name: Generate llms-full.txt
run: |
OUTPUT_FILE="_site/llms-full.txt"
> "$OUTPUT_FILE"
echo "This document contains the full Markdown documentation for DevContainers." >> "$OUTPUT_FILE"
echo "The files are separated by lines of dashes, and each starts with its file path." >> "$OUTPUT_FILE"
find _site -type f -name "*.md" -print0 | sort -z | while IFS= read -r -d '' filepath; do
echo -e "\n\n-----------------------------------------------------------------\n" >> "$OUTPUT_FILE"
cat "$filepath" >> "$OUTPUT_FILE"
done
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4