Skip to content

Build and Push Docker Image #1

Build and Push Docker Image

Build and Push Docker Image #1

Workflow file for this run

name: Build and Push Docker Image
on:
workflow_dispatch: # 只保留手动触发的方式
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Remove .git directory
run: rm -rf .git
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/linksumm:latest