mirror of
https://github.com/chaos-zhu/easynode.git
synced 2026-06-04 17:49:12 +08:00
👷 支持action自动化构建镜像
This commit is contained in:
34
.github/workflows/docker-build.yml
vendored
Normal file
34
.github/workflows/docker-build.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Docker Build and Push
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Check out the repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
chaoszhu/easynode:${{ github.event.release.tag_name }}
|
||||
chaoszhu/easynode:latest
|
||||
|
||||
- name: Clean up post-build
|
||||
run: docker system prune -af
|
||||
Reference in New Issue
Block a user