From caa91fce2275907edb286848dc82cd8ba198aa19 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Fri, 19 Jul 2024 11:31:55 +0200 Subject: [PATCH] Fix deploy --- .github/workflows/DevelopServerDeploy.yml | 11 +++++------ .github/workflows/ProdServerDeploy.yml | 11 +++++------ .github/workflows/pull-request.yml | 11 +++++------ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/DevelopServerDeploy.yml b/.github/workflows/DevelopServerDeploy.yml index 6060a994..11f73811 100644 --- a/.github/workflows/DevelopServerDeploy.yml +++ b/.github/workflows/DevelopServerDeploy.yml @@ -57,12 +57,11 @@ jobs: - name: Copy index for vite run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/dev.wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo - - uses: whoan/docker-build-with-cache-action@v8 + - uses: docker/build-push-action@v6 with: - image_name: "wikigdrive-develop" - image_tag: "${{ github.sha }},latest" - push_image_and_stages: false - build_extra_args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" + tags: "wikigdrive-develop:${{ github.sha }},wikigdrive-develop:latest" + push: false + build-args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" - name: Stop and remove run: docker stop wikigdrive-develop ; docker rm wikigdrive-develop @@ -71,7 +70,7 @@ jobs: - name: Start run: | docker run -d --name wikigdrive-develop \ - --restart unless-stopped --restart-delay 30s \ + --restart unless-stopped \ --network nginx \ -v wikiGDriveDevelop:/data \ -v /home/wikigdrive/service_account.json:/service_account.json \ diff --git a/.github/workflows/ProdServerDeploy.yml b/.github/workflows/ProdServerDeploy.yml index 889eef9e..b6ed80f4 100644 --- a/.github/workflows/ProdServerDeploy.yml +++ b/.github/workflows/ProdServerDeploy.yml @@ -58,12 +58,11 @@ jobs: - name: Copy index for vite run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo - - uses: whoan/docker-build-with-cache-action@v8 + - uses: docker/build-push-action@v6 with: - image_name: "wikigdrive-prod" - image_tag: "${{ github.sha }},latest" - push_image_and_stages: false - build_extra_args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" + tags: "wikigdrive-prod:${{ github.sha }},wikigdrive-prod:latest" + push: false + build-args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" - name: Stop and remove run: docker stop wikigdrive-prod ; docker rm wikigdrive-prod @@ -79,7 +78,7 @@ jobs: -v "/var/www/wikigdrive.com:/usr/src/app/dist/hugo" \ -e "GIT_SHA=${GITHUB_SHA}" \ --publish 127.0.0.1:3000:3000 \ - --restart unless-stopped --restart-delay 30s \ + --restart unless-stopped \ "wikigdrive-prod:${GITHUB_SHA}" wikigdrive \ --service_account /service_account.json \ --share_email mie-docs-wikigdrive@wikigdrive.iam.gserviceaccount.com \ diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 55849265..2df7b605 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -62,12 +62,11 @@ jobs: run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/pr-${{ github.event.number }}.wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo - name: build - uses: whoan/docker-build-with-cache-action@v8 + uses: docker/build-push-action@v6 with: - image_name: "wikigdrive-feature" - image_tag: "${{ github.sha }}" - push_image_and_stages: false - build_extra_args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" + tags: "wikigdrive-feature:${{ github.sha }}" + push: false + build-args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" - name: Stop and remove run: docker stop "pr-${{ github.event.number }}" ; docker rm "pr-${{ github.event.number }}" @@ -79,7 +78,7 @@ jobs: - name: Start run: | docker run -d --name "pr-${{ github.event.number }}" \ - --restart unless-stopped --restart-delay 30s \ + --restart unless-stopped \ --network nginx \ -v "pr-${{ github.event.number }}":/data \ -v /home/wikigdrive/service_account.json:/service_account.json \