-
Notifications
You must be signed in to change notification settings - Fork 78
128 lines (118 loc) · 3.29 KB
/
build-docs.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build and deploy static websites
on:
workflow_dispatch:
push:
branches:
- master
paths:
- packages/**
pull_request:
env:
GIT_LFS_SKIP_SMUDGE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
id-token: write
packages: write
jobs:
docker:
runs-on: [ubuntu-latest]
needs: [checks]
env:
REGISTRY_URL: ghcr.io
strategy:
fail-fast: false
matrix:
docker:
- name: Build Specs image
image: specs
path: specs
- name: Build Docs image
image: docs
path: docs
- name: Build Docs image
image: community
path: community
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: ${{ matrix.docker.name }}
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: ${{ github.ref == 'refs/heads/master' }}
tags: ${{ env.REGISTRY_URL }}/anoma/namada-docs:${{ matrix.docker.image }}-main
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"TARGET=${{ matrix.docker.path }}"
cloudfront:
runs-on: [ubuntu-latest]
needs: [checks]
if: ${{ github.ref == 'refs/heads/master' }}
env:
NEXT_TELEMETRY_DISABLED: 1
strategy:
fail-fast: false
matrix:
make:
- name: Specs docs
path: specs
bucket: namada-specs-frontend-prod
- name: Docs docs
path: docs
bucket: namada-docs-frontend-prod
- name: Rpgf docs
path: community
bucket: namada-rpgf-frontend-prod
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
retry-max-attempts: 3
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build ${{ matrix.make.name }}
run: npm run build:${{ matrix.make.path }}
- name: Deploy ${{ matrix.make.name }}
run: aws s3 sync packages/${{ matrix.make.path }}/out s3://${{ matrix.make.bucket }} --delete
checks:
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
make:
- name: docs
path: docs
# - name: specs
# path: specs
- name: community
path: community
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: --offline packages/${{ matrix.make.path }}/pages/