-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47733ba
commit 81b7d49
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build And Push Docker Container | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
send-start-message: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 发送构建开始的消息到 TG | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TG_TO }} | ||
token: ${{ secrets.TG_TOKEN }} | ||
format: markdown | ||
message: | | ||
构建开始 | ||
名称:MakeItAQuote TG Bot | ||
构建基于: `${{ github.event.ref }}` `${{ github.event.commits[0].id }}` | ||
提交消息:${{ github.event.commits[0].message }}(${{ github.event.commits[0].author.name }}) | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 拉取项目代码 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
# 登录到 GitHub | ||
- name: Login to GitHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
# 构建和推送镜像 | ||
- name: Build And Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
ghcr.io/lemonnekogh/make-it-a-quote-tg:latest | ||
- name: 发送构建完成的消息到 TG | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TG_TO }} | ||
token: ${{ secrets.TG_TOKEN }} | ||
format: markdown | ||
message: | | ||
构建并上传镜像完成 | ||
名称:MakeItAQuote TG Bot | ||
构建基于: `${{ github.event.ref }}` `${{ github.event.commits[0].id }}` | ||
提交消息:${{ github.event.commits[0].message }}(${{ github.event.commits[0].author.name }}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:16-alpine | ||
|
||
WORKDIR /app/ | ||
|
||
COPY . . | ||
|
||
RUN npm i -g pnpm | ||
# 安装 node-canvas 需要的包 | ||
RUN apk add pixman-dev cairo-dev pango-dev | ||
# 安装 alpine linux 缺少的包 | ||
RUN apk add python3 make g++ pkgconfig | ||
RUN pnpm i | ||
|
||
CMD ["pnpm", "dev"] |