Skip to content

Commit 8014c04

Browse files
committed
Merge branch 'master' of github.com:squidfunk/mkdocs-material
2 parents 2a849a3 + 6d22f3d commit 8014c04

31 files changed

+293
-397
lines changed

.github/assets/logo-dark.svg

-236
This file was deleted.

.github/assets/logo.svg

+2-3
Loading

.github/workflows/build.yml

+115-4
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,23 @@
2020

2121
name: build
2222
on:
23-
- push
24-
- pull_request
23+
push:
24+
branches:
25+
- master
26+
pull_request:
27+
release:
28+
types:
29+
- published
2530

2631
env:
2732
NODE_VERSION: 14.x
33+
PYTHON_VERSION: 3.x
2834

2935
permissions:
3036
contents: read
3137

3238
jobs:
33-
build:
34-
name: Build project
39+
npm:
3540
runs-on: ubuntu-latest
3641
steps:
3742

@@ -61,3 +66,109 @@ jobs:
6166
run: |
6267
npm run build
6368
git diff --name-only
69+
70+
pypi:
71+
runs-on: ubuntu-latest
72+
steps:
73+
74+
- name: Checkout repository
75+
uses: actions/checkout@v3
76+
77+
- name: Set up Python runtime
78+
uses: actions/setup-python@v4
79+
with:
80+
python-version: ${{ env.PYTHON_VERSION }}
81+
82+
- name: Set up Python dependencies
83+
run: pip install --upgrade build twine
84+
85+
- name: Build Python package
86+
run: python -m build
87+
88+
- name: Publish Python package
89+
if: github.event_name == 'release'
90+
env:
91+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
92+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
93+
run: twine upload --disable-progress-bar -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} dist/*
94+
95+
docker:
96+
runs-on: ubuntu-latest
97+
steps:
98+
99+
- name: Checkout repository
100+
uses: actions/checkout@v3
101+
102+
- name: Set up QEMU
103+
uses: docker/setup-qemu-action@v2
104+
105+
- name: Set up Docker Buildx
106+
uses: docker/setup-buildx-action@v2
107+
108+
- name: Login to DockerHub
109+
if: github.event_name == 'release'
110+
uses: docker/login-action@v2
111+
with:
112+
username: ${{ secrets.DOCKER_USERNAME }}
113+
password: ${{ secrets.DOCKER_PASSWORD }}
114+
115+
- name: Login to GitHub Container Registry
116+
if: github.event_name == 'release'
117+
uses: docker/login-action@v2
118+
with:
119+
registry: ghcr.io
120+
username: ${{ github.repository_owner }}
121+
password: ${{ secrets.GHCR_TOKEN }}
122+
123+
- name: Generate Docker tags and labels
124+
id: meta
125+
uses: docker/metadata-action@v4
126+
with:
127+
images: |
128+
${{ github.event.repository.full_name }}
129+
ghcr.io/${{ github.event.repository.full_name }}
130+
tags: |
131+
type=ref,event=branch
132+
type=ref,event=tag
133+
type=ref,event=pr
134+
flavor: |
135+
latest=${{ github.event.release.prerelease == false }}
136+
137+
- name: Build Docker image
138+
uses: docker/build-push-action@v4
139+
with:
140+
context: .
141+
load: true
142+
tags: ${{ steps.meta.outputs.tags }}
143+
labels: ${{ steps.meta.outputs.labels }}
144+
145+
- name: Check Docker image
146+
working-directory: /tmp
147+
run: |
148+
docker run --rm -i -v ${PWD}:/docs ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }} new .
149+
docker run --rm -i -v ${PWD}:/docs ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }} build
150+
151+
- name: Set platforms
152+
if: github.event_name == 'release'
153+
run: |
154+
echo "PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7" >> $GITHUB_ENV
155+
156+
- name: Publish Docker image
157+
uses: docker/build-push-action@v4
158+
with:
159+
context: .
160+
platforms: ${{ env.PLATFORMS }}
161+
push: ${{ github.event_name == 'release' }}
162+
tags: ${{ steps.meta.outputs.tags }}
163+
labels: ${{ steps.meta.outputs.labels }}
164+
165+
- name: Check manifest
166+
if: github.event_name == 'release'
167+
run: |
168+
docker buildx imagetools inspect ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }}
169+
170+
- name: Inspect image
171+
if: github.event_name == 'release'
172+
run: |
173+
docker pull ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }}
174+
docker image inspect ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)