From 8bccf894ab6d717c103f39eb223cc46f66c1bdcc Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Sun, 30 Jun 2024 23:24:49 +0800 Subject: [PATCH] add build steps. --- .gitea/workflows/deploy.yaml | 6 ++++++ act_runner.dockerfile | 6 +++--- resources/build.sh | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 35f0506..07476fc 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -13,6 +13,12 @@ jobs: with: files: | **.dockerfile + - name: Log in to Docker Registry + uses: docker/login-action@v2 + with: + registry: frp-by1.wwvvww.cn:45288 + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build docker image and deploy. run: | for file in ${{ steps.changed-dockerfiles.outputs.all_changed_files }}; do diff --git a/act_runner.dockerfile b/act_runner.dockerfile index 1bb23a5..3bd3550 100644 --- a/act_runner.dockerfile +++ b/act_runner.dockerfile @@ -8,7 +8,7 @@ ENV ACT_VERSION 0.2.10 RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources \ && apt update \ - && apt install -y ca-certificates curl git tini \ + && apt install -y ca-certificates curl git gettext jq tini \ && curl https://gitea.com/gitea/act_runner/releases/download/v${ACT_VERSION}/act_runner-${ACT_VERSION}-linux-amd64 -o /usr/local/bin/act_runner \ && chmod +x /usr/local/bin/act_runner \ && install -m 0755 -d /etc/apt/keyrings \ @@ -23,5 +23,5 @@ COPY resources/act_runner.sh /opt/act/run.sh ENTRYPOINT ["tini","--","/opt/act/run.sh"] -# docker build --progress tty -f act_runner.dockerfile -t act_runner:0.2.10 . -# docker tag act_runner:0.2.10 frp-by1.wwvvww.cn:45288/act_runner:0.2.10 \ No newline at end of file +# docker build --progress tty -f act_runner.dockerfile -t frp-by1.wwvvww.cn:45288/act_runner:0.2.10 . +# docker push frp-by1.wwvvww.cn:45288/act_runner:0.2.10 \ No newline at end of file diff --git a/resources/build.sh b/resources/build.sh index d5b9189..65579fb 100755 --- a/resources/build.sh +++ b/resources/build.sh @@ -3,6 +3,18 @@ function build() { local DOCKERFILE=$1 echo "build $DOCKERFILE" + if [[ $DOCKERFILE == *"act_runner.dockerfile" ]]; then + docker build -f $DOCKERFILE -t frp-by1.wwvvww.cn:45288/act_runner:0.2.10 . + docker push frp-by1.wwvvww.cn:45288/act_runner:0.2.10 + elif [[ $DOCKERFILE == *"nanopb.dockerfile" ]]; then + docker build -f $DOCKERFILE -t frp-by1.wwvvww.cn:45288/nanopb:0.3.9.3 . + docker push frp-by1.wwvvww.cn:45288/nanopb:0.3.9.3 + elif [[ $DOCKERFILE == *"ubuntu2404.dockerfile" ]]; then + docker build -f $DOCKERFILE -t frp-by1.wwvvww.cn:45288/ubuntu_dev:24.04 . + docker push frp-by1.wwvvww.cn:45288/ubuntu_dev:24.04 + else + echo "not found steps for build $DOCKERFILE ..." + fi } function deploy(){