👷 docker: github registry with actions
This commit is contained in:
23
.github/workflows/docker.yml
vendored
Normal file
23
.github/workflows/docker.yml
vendored
Normal 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
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
### 注意事项 ⚠️
|
### 注意事项 ⚠️
|
||||||
|
Reference in New Issue
Block a user