mirror of
https://github.com/m1ngsama/FUJI.git
synced 2025-12-24 10:51:27 +00:00
43 lines
946 B
YAML
43 lines
946 B
YAML
name: build-deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
paths-ignore: # 忽略的文件
|
|
- "README.md"
|
|
- "LICENSE"
|
|
- "CHANGELOG.md"
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: home
|
|
IMAGE_NAME_FULL: ghcr.io/nbtca/home
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# 切换分支
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
|
|
- name: Login DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Push to DockerHub
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
no-cache: true
|
|
# target: deploy
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.IMAGE_NAME_FULL }}:latest
|