-
Notifications
You must be signed in to change notification settings - Fork 70
122 lines (102 loc) · 4.33 KB
/
Copy pathrelease-docs.yml
File metadata and controls
122 lines (102 loc) · 4.33 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
name: Release - Docs (offline image + tarball)
on:
push:
tags:
- 'docs-v*'
concurrency:
group: release-docs-${{ github.ref }}
cancel-in-progress: false
# Workflow-level permissions: nothing. Each job declares only what it needs.
# Opt into Node 24 for bundled-JS actions ahead of GitHub's June 16, 2026 cutoff.
# https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
version:
runs-on: ubuntu-latest
permissions: {}
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- id: extract
shell: bash
run: |
# tag form: docs-v2.1.0 -> 2.1.0
version="${GITHUB_REF_NAME#docs-v}"
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
echo "::error::tag ${GITHUB_REF_NAME} does not match docs-vMAJOR.MINOR.PATCH(-prerelease)"
exit 1
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
tarball:
needs: version
runs-on: ubuntu-latest
permissions:
contents: write # create GitHub Release + upload tarball asset
env:
OFFLINE_BUILD: '1'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
cache: npm
- name: Install
run: npm ci
- name: Build offline docs
run: npm run build
- name: Create tarball
run: |
VERSION="${{ needs.version.outputs.version }}"
tar czf "wasmcloud-docs-${VERSION}.tar.gz" -C build .
sha256sum "wasmcloud-docs-${VERSION}.tar.gz" > "wasmcloud-docs-${VERSION}.tar.gz.sha256"
- name: Create GitHub Release
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
with:
name: Offline docs ${{ needs.version.outputs.version }}
generate_release_notes: true
files: |
wasmcloud-docs-${{ needs.version.outputs.version }}.tar.gz
wasmcloud-docs-${{ needs.version.outputs.version }}.tar.gz.sha256
body: |
Air-gapped wasmCloud documentation bundle, version ${{ needs.version.outputs.version }}.
**Container image:** `ghcr.io/wasmcloud/docs:${{ needs.version.outputs.version }}` (also tagged `:latest`).
**Tarball:** extract anywhere and serve as static files. The site is built with `trailingSlash: true`, so URLs end in `/` and resolve to `<dir>/index.html`. Example:
```shell
tar xzf wasmcloud-docs-${{ needs.version.outputs.version }}.tar.gz -C /var/www/docs
python -m http.server 8080 --directory /var/www/docs
```
See the [Private Registries and Air-Gapped Deployments guide](https://wasmcloud.com/docs/kubernetes-operator/operator-manual/private-registries/) for the in-cluster pattern.
image:
needs: version
runs-on: ubuntu-latest
permissions:
packages: write # push image to ghcr.io
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Log in to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/wasmcloud/docs:${{ needs.version.outputs.version }}
ghcr.io/wasmcloud/docs:latest
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.version=${{ needs.version.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}