Skip to content

Commit 3e09301

Browse files
committed
[ci skip] added docker image to rust docs
1 parent 1fe85fc commit 3e09301

11 files changed

+83
-24
lines changed

.dockerignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
target
2+
!target/doc
23
.changelog
34
.github
45
.vscode
56
audit
67
test
78
wasm_for_tests
89
genesis
9-
docker
10+
test_fixtures
11+
.changelog

.github/workflows/automation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- uses: xt0rted/pull-request-comment-branch@v1
5555
if: steps.check.outputs.triggered == 'true'
5656
id: comment-branch
57-
- uses: actions/checkout@v3
57+
- uses: actions/checkout@4v3
5858
if: steps.check.outputs.triggered == 'true'
5959
with:
6060
ref: ${{ steps.comment-branch.outputs.head_ref }}

.github/workflows/build-and-test.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repo
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@4v3
4444
if: ${{ github.event_name != 'pull_request_target' }}
4545
- name: Checkout PR
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@4v3
4747
if: ${{ github.event_name == 'pull_request_target' }}
4848
# From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target:
4949
# "This event runs in the context of the base of the pull request,
@@ -84,10 +84,10 @@ jobs:
8484

8585
steps:
8686
- name: Checkout repo
87-
uses: actions/checkout@v3
87+
uses: actions/checkout@4v3
8888
if: ${{ github.event_name != 'pull_request_target' }}
8989
- name: Checkout PR
90-
uses: actions/checkout@v3
90+
uses: actions/checkout@4v3
9191
if: ${{ github.event_name == 'pull_request_target' }}
9292
with:
9393
ref: ${{ github.event.pull_request.head.sha }}
@@ -171,10 +171,10 @@ jobs:
171171

172172
steps:
173173
- name: Checkout repo
174-
uses: actions/checkout@v3
174+
uses: actions/checkout@4v3
175175
if: ${{ github.event_name != 'pull_request_target' }}
176176
- name: Checkout PR
177-
uses: actions/checkout@v3
177+
uses: actions/checkout@4v3
178178
if: ${{ github.event_name == 'pull_request_target' }}
179179
# See comment in build-and-test.yml
180180
with:
@@ -271,10 +271,10 @@ jobs:
271271

272272
steps:
273273
- name: Checkout repo
274-
uses: actions/checkout@v3
274+
uses: actions/checkout@4v3
275275
if: ${{ github.event_name != 'pull_request_target' }}
276276
- name: Checkout PR
277-
uses: actions/checkout@v3
277+
uses: actions/checkout@4v3
278278
if: ${{ github.event_name == 'pull_request_target' }}
279279
# See comment in build-and-test.yml
280280
with:
@@ -380,10 +380,10 @@ jobs:
380380

381381
steps:
382382
- name: Checkout repo
383-
uses: actions/checkout@v3
383+
uses: actions/checkout@4v3
384384
if: ${{ github.event_name != 'pull_request_target' }}
385385
- name: Checkout PR
386-
uses: actions/checkout@v3
386+
uses: actions/checkout@4v3
387387
if: ${{ github.event_name == 'pull_request_target' }}
388388
# See comment in build-and-test.yml
389389
with:

.github/workflows/checks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343

4444
steps:
4545
- name: Checkout repo
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@4v3
4747
if: ${{ github.event_name != 'pull_request_target' }}
4848
- name: Checkout PR
49-
uses: actions/checkout@v3
49+
uses: actions/checkout@4v3
5050
if: ${{ github.event_name == 'pull_request_target' }}
5151
# See comment in build-and-test.yml
5252
with:

.github/workflows/cron.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repo
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@4v3
4242
- name: Setup rust nightly
4343
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
4444
with:

.github/workflows/docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repo
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@4v3
4242
- name: Set up QEMU
4343
uses: docker/setup-qemu-action@v2
4444
- name: Set up Docker Buildx

.github/workflows/docs.yml

+36-6
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
command: cargo run --bin namada_encoding_spec && cd documentation/dev && mdbook build
4343
cache_subkey: dev
4444
cache_version: v1
45-
distribution_id: E6XPP5KFWXJFQ
4645

4746
env:
4847
CARGO_INCREMENTAL: 0
@@ -52,10 +51,10 @@ jobs:
5251

5352
steps:
5453
- name: Checkout repo
55-
uses: actions/checkout@v3
54+
uses: actions/checkout@4v3
5655
if: ${{ github.event_name != 'pull_request_target' }}
5756
- name: Checkout PR
58-
uses: actions/checkout@v3
57+
uses: actions/checkout@4v3
5958
if: ${{ github.event_name == 'pull_request_target' }}
6059
# See comment in build-and-test.yml
6160
with:
@@ -126,10 +125,10 @@ jobs:
126125

127126
steps:
128127
- name: Checkout repo
129-
uses: actions/checkout@v3
128+
uses: actions/checkout@4v3
130129
if: ${{ github.event_name != 'pull_request_target' }}
131130
- name: Checkout PR
132-
uses: actions/checkout@v3
131+
uses: actions/checkout@4v3
133132
if: ${{ github.event_name == 'pull_request_target' }}
134133
# See comment in build-and-test.yml
135134
with:
@@ -163,7 +162,38 @@ jobs:
163162
run: make build-doc
164163
- name: Print sccache stats
165164
if: always()
166-
run: sccache --show-stats
165+
run: sccache --show-stats || true
167166
- name: Stop sccache server
168167
if: always()
169168
run: sccache --stop-server || true
169+
- name: Set up Docker Buildx
170+
uses: docker/setup-buildx-action@v2
171+
with:
172+
version: v0.9.1
173+
- name: Login to private registry
174+
uses: docker/login-action@v1
175+
with:
176+
registry: ${{ secrets.REGISTRY_URL }}
177+
username: ${{ secrets.REGISTRY_USERNAME }}
178+
password: ${{ secrets.REGISTRY_PASSWORD }}
179+
- name: Docker meta
180+
id: meta
181+
uses: docker/metadata-action@v4
182+
with:
183+
images: ${{ secrets.REGISTRY_URL }}/namada-rust-docs
184+
tags: |
185+
type=schedule
186+
type=ref,event=branch
187+
type=ref,event=pr
188+
type=semver,pattern={{version}}
189+
type=semver,pattern={{major}}.{{minor}}
190+
type=semver,pattern={{major}}
191+
type=raw,value=latest
192+
- name: ${{ matrix.make.name }}
193+
uses: docker/build-push-action@v4
194+
with:
195+
context: .
196+
file: docker/docs/Dockerfile
197+
push: ${{ github.ref == 'refs/heads/main' }}
198+
tags: ${{ steps.meta.outputs.tags }}
199+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Checkout repo
36-
uses: actions/checkout@v3
36+
uses: actions/checkout@4v3
3737
with:
3838
fetch-depth: 0
3939
- run: git fetch --tags --force origin # WA: https://github.com/actions/checkout/issues/882

.github/workflows/triggerable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
SCCACHE_BUCKET: namada-sccache-master
4747

4848
steps:
49-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@4v3
5050
with:
5151
ref: ${{ inputs.branch }}
5252
- name: Configure AWS Credentials

docker/docs/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM nginx:alpine
2+
3+
COPY docker/docs/nginx.conf /etc/nginx/conf.d/default.conf
4+
5+
WORKDIR /usr/share/nginx/html
6+
RUN rm -rf ./*
7+
8+
COPY target/doc .
9+
10+
EXPOSE 3000
11+
12+
CMD ["nginx", "-g", "daemon off;"]

docker/docs/nginx.conf

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
server {
2+
listen 3000;
3+
root /usr/share/nginx/html;
4+
5+
error_page 404 /namada/index.html;
6+
7+
location /stati.files {
8+
add_header Cache-Control "max-age=31536000";
9+
}
10+
11+
location / {
12+
try_files $uri.html $uri /namada/index.html;
13+
add_header Cache-Control "no-cache";
14+
}
15+
}

0 commit comments

Comments
 (0)