Skip to content

Commit c012f84

Browse files
committed
🐳 chore: Docker 自动部署
1 parent a57a18b commit c012f84

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/docker.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Docker image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
push_to_registry:
9+
name: Push Docker image to multiple registries
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: read
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v4
17+
18+
- name: Log in to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKER_USERNAME }}
22+
password: ${{ secrets.DOCKER_PASSWORD }}
23+
24+
- name: Log in to the Container registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Extract metadata (tags, labels) for Docker
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: |
36+
imsyy/splayer
37+
ghcr.io/${{ github.repository }}
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
file: ./Dockerfile
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)