From cb7f6984a28ffd8f8b07c208b1450253b77ed287 Mon Sep 17 00:00:00 2001 From: Zsman Date: Mon, 19 Jun 2023 17:07:09 +0800 Subject: [PATCH] Create build-image --- .github/workflows/build-image | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build-image diff --git a/.github/workflows/build-image b/.github/workflows/build-image new file mode 100644 index 0000000..c1ea445 --- /dev/null +++ b/.github/workflows/build-image @@ -0,0 +1,38 @@ +name: Build Image + + +on: + workflow_dispatch: + inputs: + release_tag: + description: 'Tag for the images' + required: true + +env: + REGISTRY: registry.cn-hongkong.aliyuncs.com + NAMESPACE: chatwithpaper + IMAGE: academic + TAG: ${{ github.event.inputs.release_tag || github.event.client_payload.release_tag }} + +jobs: + build: + runs-on: ubuntu-latest + environment: production + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to Registry + uses: docker/login-action@v2.1.0 + with: + registry: "${{ env.REGISTRY }}" + username: "${{ secrets.ACR_USER }}" + password: "${{ secrets.ACR_PASSWORD }}" + + - name: Build and push image + uses: docker/build-push-action@v4 + with: + context: . + file: docs/Dockerfile+NoLocal+Latex + tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE }}:${{ env.TAG }} + push: true