-
Notifications
You must be signed in to change notification settings - Fork 199
70 lines (70 loc) · 2.16 KB
/
Copy pathcd.yml
File metadata and controls
70 lines (70 loc) · 2.16 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
name: CD
on:
release:
types: [published]
permissions:
contents: read
jobs:
pages:
runs-on: ubuntu-24.04
timeout-minutes: 20
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false # no step pushes back to the repository
- name: Install mise toolchain
uses: jdx/mise-action@v4
with:
cache: false # a poisoned tool cache must never reach published artifacts
- name: Build API documentation
run: mise run docs
- name: Configure Pages
uses: actions/configure-pages@v6
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: docs/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
image:
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false # the registry login below carries its own token
- name: Set lower-case image path
# GitHub expands `${{ }}` before the shell runs, so repository references reach
# the script through `env:` rather than being interpolated into the command.
env:
REPOSITORY: ${{ github.repository }}
run: echo "IMAGE=$(echo "ghcr.io/$REPOSITORY" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:${{ github.ref_name }}