Skip to content

feat: 添加日志

feat: 添加日志 #34

Workflow file for this run

name: docker image build and push
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64
tags: ${{ secrets.DOCKERHUB_REPOSITORY }}:latest
# deploy:
# needs: [build]
# name: Pull Docker
# runs-on: ubuntu-latest
# steps:
# - name: Deploy
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.SSH_PASSWORD }}
# script: |
# cd /data/docker
# docker-compose stop blog_web
# docker rm -f $(docker ps -a --filter ancestor=${{ secrets.DOCKERHUB_REPOSITORY }}:latest -q)
# docker rmi -f $(docker images ${{ secrets.DOCKERHUB_REPOSITORY }}:latest -q)
# docker login --username=${{ secrets.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }} registry.cn-hangzhou.aliyuncs.com
# docker pull ${{ secrets.DOCKERHUB_REPOSITORY }}:latest
# docker-compose up -d --build