-
-
Notifications
You must be signed in to change notification settings - Fork 8
100 lines (85 loc) · 2.55 KB
/
cd.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
name: Continuous Delivery
on:
push:
branches: [ "main" ]
jobs:
publish-docker:
environment: Production
name: "Build & Push docker image (dev)"
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ github.repository }}:dev
ghcr.io/${{ github.repository }}:dev
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,
- name: Update docker hub description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ github.repository }}
enable-url-completion: true
publish-docs:
name: "Deploy documentation"
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: Documentation Center
url: ${{ steps.deployment.outputs.page_url }}
defaults:
run:
working-directory: docs
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build docusaurus
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload docs build
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4