From 8648b81fedccefca534ebfb3fe750a3bd2e2f542 Mon Sep 17 00:00:00 2001 From: rise0chen Date: Fri, 6 Dec 2024 15:53:34 +0800 Subject: [PATCH] ci --- .github/workflows/publish.yml | 42 +++++++---------------------------- Dockerfile | 13 +++++++++++ 2 files changed, 21 insertions(+), 34 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 427819c..ad44057 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,47 +1,21 @@ name: Publish on: [push, pull_request] -env: - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - jobs: publish: name: publish runs-on: ubuntu-latest - container: registry.cn-shanghai.aliyuncs.com/lebai/util:14.04 steps: - name: Checkout uses: actions/checkout@v3 with: submodules: true - - name: Install Tools - run: | - sudo apt-get update - sudo apt-get install -y zip - - name: Install ali ossutil - uses: manyuanrong/setup-ossutil@v3.0 - with: - endpoint: ${{ secrets.AWS_ENDPOINT }} - access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - access-key-secret: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: install rust targets - run: | - rustup target add x86_64-unknown-linux-gnu - rustup target add aarch64-unknown-linux-gnu - - uses: Swatinem/rust-cache@v2 - continue-on-error: true - - name: Install Cross Compiler - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf libc6-dev-armhf-cross - sudo apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross - name: Publish - env: - AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: bash ./ci.sh + uses: docker/build-push-action@v6 + with: + push: false + tags: lebai/plugin:latest + build-args: + - AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }} + - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe05ac9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM registry.cn-shanghai.aliyuncs.com/lebai/util:14.04 + +WORKDIR /app +COPY . . + +ARG AWS_ENDPOINT +ARG AWS_ACCESS_KEY_ID +ARG AWS_SECRET_ACCESS_KEY +ENV AWS_ENDPOINT=${AWS_ENDPOINT} +ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} +ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} + +RUN bash ./ci.sh