feat: add build&push docker image action

* feat: add build&push docker image action

* fix file end line
This commit is contained in:
STEVEN
2021-12-14 10:17:24 +08:00
committed by GitHub
parent 27bd3e80de
commit 247e37d5af
4 changed files with 41 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
name: build-and-push-docker-image
on:
push:
branches:
- "main"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_NEOSMEMO_USERNAME }}
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_NEOSMEMO_USERNAME }}/memos:latest