From 405e453ed395c4e1d2f7efc4ab4e70129be238bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=93=E6=9D=B0?= <2561589453@qq.com> Date: Sat, 22 Apr 2023 19:06:49 +0800 Subject: [PATCH] ci: build arm and amd image when push MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 晓杰 <2561589453@qq.com> --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..72e830320 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + workflow_dispatch: + + push: + branches: + - "main" + +jobs: + release: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Dependencies + run: | + sudo apt update && sudo apt install -y nodejs npm + - # Add support for more platforms with QEMU (optional) + # https://github.com/docker/setup-qemu-action + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: network=host + + - name: Login to gitbub + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_PAT }} + - name: build and publish image + env: + # fork friendly ^^ + DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/fast-gpt + run: | + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --label "org.opencontainers.image.licenses=MIT" \ + --push \ + -t ${DOCKER_REPO}:latest \ + -f Dockerfile \ + .