ci: dockerhub

This commit is contained in:
liuweiqing 2024-02-11 18:29:38 +08:00
parent 336399e76b
commit cb2c46c7ca

View File

@ -1,25 +1,30 @@
name: Node.js CI
name: PaperAI Docker Image Push
on:
push:
branches: [main]
pull_request:
branches: [main]
branches:
- main
paths:
- "./"
jobs:
build:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Check Out Repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: 14790897/PaperAI:latest