Skip to content

Commit 9c24ef6

Browse files
committed
Add Docker deployment workflow and Dockerfile for website
1 parent 3e35266 commit 9c24ef6

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/docker.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Docker website
2+
on:
3+
push:
4+
branches:
5+
- gh-pages
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build_docker:
13+
name: Docker
14+
runs-on: ubuntu-latest
15+
needs: build
16+
permissions:
17+
pages: write # Required to deploy to GitHub Pages.
18+
id-token: write # Required to verify that the deployment originates from this workflow.
19+
20+
steps:
21+
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
branch: gh-pages
27+
28+
- name: Docker meta
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: xhofe/alist-docs
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Login to DockerHub
41+
if: github.event_name == 'push'
42+
uses: docker/login-action@v3
43+
with:
44+
username: xhofe
45+
password: ${{ secrets.DOCKERHUB_TOKEN }}
46+
47+
- name: Build and push
48+
id: docker_build
49+
uses: docker/build-push-action@v5
50+
with:
51+
context: .
52+
file: Dockerfile
53+
push: ${{ github.event_name == 'push' }}
54+
tags: ${{ steps.meta.outputs.tags }}
55+
labels: ${{ steps.meta.outputs.labels }}
56+
platforms: linux/amd64,linux/arm64,linux/arm/v7

docs/.vuepress/public/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM halverneus/static-file-server:latest
2+
3+
# Copy your static files
4+
COPY . /web

0 commit comments

Comments
 (0)