Docker Image CI #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
# 定义触发条件:每周一运行 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1" # 每周一 00:00 UTC | |
# 定义工作流的步骤 | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . # Dockerfile 所在的目录 | |
file: ./Dockerfile # Dockerfile 文件路径 | |
push: true | |
tags: hookbin/code-server-nvm-nodejs:latest |