Skip to content

Commit 5d1281c

Browse files
authored
Create docker-image.yml
1 parent c79e574 commit 5d1281c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docker Image CI
2+
3+
# 定义触发条件:每周一运行
4+
on:
5+
schedule:
6+
- cron: "0 0 * * 1" # 每周一 00:00 UTC
7+
8+
# 定义工作流的步骤
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v2
22+
with:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
25+
26+
- name: Build and push Docker image
27+
uses: docker/build-push-action@v3
28+
with:
29+
context: . # Dockerfile 所在的目录
30+
file: ./Dockerfile # Dockerfile 文件路径
31+
push: true
32+
tags: hookbin/code-server-nvm-nodejs:latest

0 commit comments

Comments
 (0)