From db3715e2663fd5bccd471d21c87962f2557725b7 Mon Sep 17 00:00:00 2001 From: Yue Fei <59813791+moria97@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:20:23 +0800 Subject: [PATCH 1/2] Create docker.yml --- .github/workflows/docker.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..92a0e59c --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,32 @@ +# +name: Create and publish a Docker image + +# Configures this workflow to run every time a change is pushed to the branch called `release`. +on: + push: + branches: ['feature'] + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: registry.cn-beijing.aliyuncs.com + +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. +jobs: + build-and-push-image: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - uses: aliyun/acr-login@v1 + with: + login-server: 'https://${{ env.REGISTRY }}' + username: ${{ secrets.ACR_USER }} + password: ${{ secrets.ACR_PASSWORD }} + + - name: Build and push image + env: + IMAGE_TAG: pairag_0.0.1 + run: | + docker build -t ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG . + docker push ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG From b128023131e4fd8a58867fe17ebc65a47b246525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=B9=E8=B7=83?= Date: Mon, 3 Jun 2024 13:52:57 +0800 Subject: [PATCH 2/2] Fix linter --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 92a0e59c..a51026c9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,7 +4,7 @@ name: Create and publish a Docker image # Configures this workflow to run every time a change is pushed to the branch called `release`. on: push: - branches: ['feature'] + branches: ["feature"] # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: @@ -20,7 +20,7 @@ jobs: # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - uses: aliyun/acr-login@v1 with: - login-server: 'https://${{ env.REGISTRY }}' + login-server: "https://${{ env.REGISTRY }}" username: ${{ secrets.ACR_USER }} password: ${{ secrets.ACR_PASSWORD }} @@ -29,4 +29,4 @@ jobs: IMAGE_TAG: pairag_0.0.1 run: | docker build -t ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG . - docker push ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG + docker push ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG