Skip to content

Test Docker

Test Docker #4

Workflow file for this run

name: Test Docker
on:
workflow_dispatch:
inputs:
target:
description: 输入打包版本号
required: true
jobs:
docker_build:
environment: docker_hub
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t dingdangdog/cashbook:${{ github.event.inputs.target }} .
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push Docker image
run: |
docker push dingdangdog/cashbook:${{ github.event.inputs.target }}
- name: Clean up Docker images
run: docker system prune -af