Skip to content

Commit

Permalink
Fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Jul 19, 2024
1 parent c7b08f7 commit caa91fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/DevelopServerDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ProdServerDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 \
Expand Down

0 comments on commit caa91fc

Please sign in to comment.