👷 docker: github registry with actions

This commit is contained in:
naiba
2021-01-04 21:29:22 +08:00
committed by dushixiang
parent c362d9b98a
commit 2d160c70f9
2 changed files with 25 additions and 2 deletions

23
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Docker image
on:
push:
branches:
- "master"
paths-ignore:
- ".gitignore"
- "*.md"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Log into registry
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Build and push image
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/next-terminal -f Dockerfile .
docker push ghcr.io/${{ github.repository_owner }}/next-terminal

View File

@ -6,7 +6,7 @@
docker run -d \ docker run -d \
-p 8088:8088 \ -p 8088:8088 \
--name next-terminal \ --name next-terminal \
--restart always dushixiang/next-terminal:latest --restart always ghcr.io/dushixiang/next-terminal:latest
``` ```
### 使用`mysql`存储数据 ### 使用`mysql`存储数据
@ -21,7 +21,7 @@ docker run -d \
-e MYSQL_PASSWORD=mysql \ -e MYSQL_PASSWORD=mysql \
-e MYSQL_DATABASE=next_terminal \ -e MYSQL_DATABASE=next_terminal \
--name next-terminal \ --name next-terminal \
--restart always dushixiang/next-terminal:latest --restart always ghcr.io/dushixiang/next-terminal:latest
``` ```
### 注意事项 ⚠️ ### 注意事项 ⚠️