From 66b4284365258d320457ebfc989ca97329b9e60a Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Wed, 25 Sep 2024 11:52:49 +0800 Subject: [PATCH] chore: add docker ci --- .github/workflows/docker_ci.yaml | 59 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 20 +++++------ 2 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/docker_ci.yaml diff --git a/.github/workflows/docker_ci.yaml b/.github/workflows/docker_ci.yaml new file mode 100644 index 0000000000000..bfb3f96bae7b1 --- /dev/null +++ b/.github/workflows/docker_ci.yaml @@ -0,0 +1,59 @@ +name: Docker-CI + +on: + push: + branches: + - "main" + - "release/*" + paths: + - ".github/workflows/docker_ci.yaml" + - "frontend/scripts/docker-buildfiles/**" + - "frontend/rust-lib/**" + - "frontend/appflowy_flutter/**" + - "frontend/resources/**" + + pull_request: + branches: + - "main" + - "release/*" + paths: + - ".github/workflows/docker_ci.yaml" + - "frontend/scripts/docker-buildfiles/**" + - "frontend/rust-lib/**" + - "frontend/appflowy_flutter/**" + - "frontend/resources/**" + +env: + FLUTTER_VERSION: "3.22.0" + # use 1.80.1 here to avoid cargo-binstall error + RUST_TOOLCHAIN: "1.80.1" + +jobs: + docker-build-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: frontend/scripts/docker-buildfiles + file: frontend/scripts/docker-buildfiles/Dockerfile + push: false + load: true + tags: app:pr-check + + # - name: Verify docker-compose + # run: | + # cd frontend/scripts/docker-buildfiles + # docker-compose -f docker-compose.yml config + # docker-compose -f docker-compose.yml up -d + # docker-compose -f docker-compose.yml down + + - name: Clean up + if: always() + run: docker image rm app:pr-check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63d04320610e4..74de877f4e6ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -232,10 +232,10 @@ jobs: matrix: job: - { - targets: "aarch64-apple-darwin,x86_64-apple-darwin", - os: macos-latest, - extra-build-args: "", - } + targets: "aarch64-apple-darwin,x86_64-apple-darwin", + os: macos-latest, + extra-build-args: "", + } steps: - name: Checkout source code uses: actions/checkout@v4 @@ -336,12 +336,12 @@ jobs: matrix: job: - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-args: "", - flutter_profile: production-linux-x86_64, - } + arch: x86_64, + target: x86_64-unknown-linux-gnu, + os: ubuntu-20.04, + extra-build-args: "", + flutter_profile: production-linux-x86_64, + } steps: - name: Checkout source code uses: actions/checkout@v4