-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7b08f7
commit 8e86d6a
Showing
3 changed files
with
69 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,66 +35,62 @@ jobs: | |
runs-on: wgd-dev | ||
|
||
steps: | ||
- name: Test | ||
run: echo "${{ github.event.number }}" | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Build action runner | ||
run: docker build -t "wgd-action-runner:pr-${{ github.event.number }}" --build-arg "GIT_SHA=${{ github.sha }}" apps/wgd-action-runner | ||
|
||
- name: Build hugo docs | ||
run: | | ||
docker run \ | ||
-v "${GITHUB_WORKSPACE}/hugo:/site" \ | ||
-v "${GITHUB_WORKSPACE}/website:/website" \ | ||
-v "/var/www/pr-${{ github.event.number }}.wikigdrive.com:/dist/hugo" \ | ||
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://pr-${{ github.event.number }}.wikigdrive.com" \ | ||
wgd-action-runner:pr-${{ github.event.number }} /steps/step_render_hugo | ||
- name: Copy index for vite | ||
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 | ||
with: | ||
image_name: "wikigdrive-feature" | ||
image_tag: "${{ github.sha }}" | ||
push_image_and_stages: false | ||
build_extra_args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}" | ||
|
||
- name: Stop and remove | ||
run: docker stop "pr-${{ github.event.number }}" ; docker rm "pr-${{ github.event.number }}" | ||
continue-on-error: true | ||
|
||
- name: "Create empty volume" | ||
run: docker volume rm -f "pr-${{ github.event.number }}" ; docker volume create "pr-${{ github.event.number }}" | ||
|
||
- name: Start | ||
run: | | ||
docker run -d --name "pr-${{ github.event.number }}" \ | ||
--restart unless-stopped --restart-delay 30s \ | ||
--network nginx \ | ||
-v "pr-${{ github.event.number }}":/data \ | ||
-v /home/wikigdrive/service_account.json:/service_account.json \ | ||
-v /home/wikigdrive/env.develop:/usr/src/app/.env \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v "/var/www/pr-${{ github.event.number }}.wikigdrive.com:/usr/src/app/dist/hugo" \ | ||
-e "GIT_SHA=${{ github.sha }}" \ | ||
-e "ZIPKIN_URL=https://pr-${{ github.event.number }}.wikigdrive.com/zipkin" \ | ||
-e "ZIPKIN_SERVICE=pr-${{ github.event.number }}" \ | ||
-e "AUTH_DOMAIN=https://dev.wikigdrive.com" \ | ||
-e "AUTH_INSTANCE=pr-${{ github.event.number }}" \ | ||
-e "DOMAIN=https://pr-${{ github.event.number }}.wikigdrive.com" \ | ||
--link=zipkin:zipkin \ | ||
"wikigdrive-feature:${{ github.sha }}" wikigdrive \ | ||
--service_account /service_account.json \ | ||
--share_email [email protected] \ | ||
--workdir /data \ | ||
server 3000 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Build action runner | ||
run: docker build -t "wgd-action-runner:pr-${{ github.event.number }}" --build-arg "GIT_SHA=${{ github.sha }}" apps/wgd-action-runner | ||
|
||
- name: Build hugo docs | ||
run: | | ||
docker run \ | ||
-v "${GITHUB_WORKSPACE}/hugo:/site" \ | ||
-v "${GITHUB_WORKSPACE}/website:/website" \ | ||
-v "/var/www/pr-${{ github.event.number }}.wikigdrive.com:/dist/hugo" \ | ||
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://pr-${{ github.event.number }}.wikigdrive.com" \ | ||
wgd-action-runner:pr-${{ github.event.number }} /steps/step_render_hugo | ||
- name: Copy index for vite | ||
run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/pr-${{ github.event.number }}.wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo | ||
|
||
- name: build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
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 }}" | ||
continue-on-error: true | ||
|
||
- name: "Create empty volume" | ||
run: docker volume rm -f "pr-${{ github.event.number }}" ; docker volume create "pr-${{ github.event.number }}" | ||
|
||
- name: Start | ||
run: | | ||
docker run -d --name "pr-${{ github.event.number }}" \ | ||
--restart unless-stopped \ | ||
--network nginx \ | ||
-v "pr-${{ github.event.number }}":/data \ | ||
-v /home/wikigdrive/service_account.json:/service_account.json \ | ||
-v /home/wikigdrive/env.develop:/usr/src/app/.env \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v "/var/www/pr-${{ github.event.number }}.wikigdrive.com:/usr/src/app/dist/hugo" \ | ||
-e "GIT_SHA=${{ github.sha }}" \ | ||
-e "ZIPKIN_URL=https://pr-${{ github.event.number }}.wikigdrive.com/zipkin" \ | ||
-e "ZIPKIN_SERVICE=pr-${{ github.event.number }}" \ | ||
-e "AUTH_DOMAIN=https://dev.wikigdrive.com" \ | ||
-e "AUTH_INSTANCE=pr-${{ github.event.number }}" \ | ||
-e "DOMAIN=https://pr-${{ github.event.number }}.wikigdrive.com" \ | ||
--link=zipkin:zipkin \ | ||
"wikigdrive-feature:${{ github.sha }}" wikigdrive \ | ||
--service_account /service_account.json \ | ||
--share_email [email protected] \ | ||
--workdir /data \ | ||
server 3000 |