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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 2 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
web/node_modules
web/yarn.lock

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

4
.gitignore vendored
View File

@ -13,8 +13,8 @@
*.log
tmp
# Config
config
# Config (Need to put in env)
# config
# Air (hot reload) generated
.air

6
config/consts.go Normal file
View File

@ -0,0 +1,6 @@
package config
var (
GITHUB_CLIENTID = "187ba36888f152b06612"
GITHUB_SECRET = "10b6fec4146cbb7bdf64016b3cf0905366a35041"
)