add build file.
Some checks failed
Deploy Docker Images / Docusaurus build and Server deploy (push) Failing after 5s

This commit is contained in:
amass 2024-06-30 22:33:23 +08:00
parent befed2dbe6
commit e2b777404d
5 changed files with 41 additions and 10 deletions

View File

@ -17,4 +17,15 @@ jobs:
run: |
for file in ${{ steps.changed-dockerfiles.outputs.all_changed_files }}; do
echo "${file} changed."
resources/build.sh build ${file}
done
- name: Notify-End
if: ${{ always() }}
run: |
echo "${{ github.repository }} 构建结束" > notify.tpl
echo "构建状态: ${{ job.status }}">> notify.tpl
echo "构建地址: https://gitea.amass.fun/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl
echo "仓库地址: https://gitea.amass.fun/${{ github.repository }}">> notify.tpl
echo "提交ID: $(git rev-parse --short HEAD)">> notify.tpl
echo -n "提交消息: ${{ github.event.head_commit.message }}">> notify.tpl
cat notify.tpl | envsubst | jq -sR . | xargs -0 -I {} curl -H "Content-Type: application/json" -X POST -d '{"type":"text","msg":{} }' https://amass.fun/notify

28
resources/build.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
function build() {
local DOCKERFILE=$1
echo "build $DOCKERFILE"
}
function deploy(){
}
function main() {
local cmd=$1
shift 1
case $cmd in
deploy)
deploy $@
;;
build)
build $@
;;
*)
build $@
;;
esac
}
main $@

View File

@ -1,6 +0,0 @@
repo: $DRONE_REPO_NAME
status: $DRONE_BUILD_STATUS
commit: $DRONE_COMMIT
构建: $DRONE_BUILD_LINK
仓库: $DRONE_REPO_LINK
提交注释: $DRONE_COMMIT_MESSAGE

View File

@ -1,12 +1,12 @@
FROM ubuntu:22.04
LABEL maintainer 168062547@qq.com
LABEL maintainer="amass <168062547@qq.com>"
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list \
&& sed -i "s@http://.*security.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list \
&& apt update \
&& apt install -y gcc g++ cmake ninja-build pkg-config openssh-server git nano gpg ca-certificates \
wget curl rsync lsb-release ubuntu-keyring gnupg2 libssl-dev \
wget curl rsync lsb-release ubuntu-keyring gnupg2 libssl-dev gettext jq \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc \

View File

@ -1,7 +1,5 @@
FROM ubuntu:24.04
LABEL maintainer="amass <168062547@qq.com>"
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources \