Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(deploy): change deploy to use a bot password #5209

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
- name: Personal Lua Deploy
if: steps.changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
LUA_DEV_ENV_NAME: "/dev/${{ github.event.inputs.luadevenv }}"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
- name: Resource Deploy
if: steps.res-changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy_res.sh "${{ steps.res-changed-files.outputs.all_changed_files }}"

- name: Lua Deploy
if: steps.lua-changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy.sh "${{ steps.lua-changed-files.outputs.all_changed_files }}"
Expand All @@ -69,8 +69,8 @@ jobs:
- name: Deploy Old Dev
if: steps.changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
Expand All @@ -79,8 +79,8 @@ jobs:
- name: Deploy New Dev
if: steps.changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL2 }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:

- name: Resource Deploy
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy_res.sh

- name: Lua Deploy
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy.sh
Expand All @@ -42,17 +42,17 @@ jobs:

- name: Deploy Old Dev
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
run: bash scripts/deploy.sh

- name: Deploy New Dev
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL2 }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
Expand Down
9 changes: 4 additions & 5 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ for luaFile in $luaFiles; do
-s \
-b "$ckf" \
-c "$ckf" \
--data-urlencode "username=${WIKI_USER}" \
--data-urlencode "password=${WIKI_PASSWORD}" \
--data-urlencode "logintoken=${loginToken}" \
--data-urlencode "loginreturnurl=${WIKI_BASE_URL}" \
--data-urlencode "lgname=${WIKI_USER}" \
--data-urlencode "lgpassword=${WIKI_PASSWORD}" \
--data-urlencode "lgtoken=${loginToken}" \
-H "User-Agent: ${userAgent}" \
-H 'Accept-Encoding: gzip' \
-H "Authorization: Basic ${DEV_WIKI_BASIC_AUTH}" \
-X POST "${wikiApiUrl}?format=json&action=clientlogin" \
-X POST "${wikiApiUrl}?format=json&action=login" \
| gunzip \
> /dev/null
loggedin[$wiki]=1
Expand Down
9 changes: 4 additions & 5 deletions scripts/deploy_res.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ curl \
-s \
-b "$ckf" \
-c "$ckf" \
--data-urlencode "username=${WIKI_USER}" \
--data-urlencode "password=${WIKI_PASSWORD}" \
--data-urlencode "logintoken=${loginToken}" \
--data-urlencode "loginreturnurl=${WIKI_BASE_URL}" \
--data-urlencode "lgname=${WIKI_USER}" \
--data-urlencode "lgpassword=${WIKI_PASSWORD}" \
--data-urlencode "lgtoken=${loginToken}" \
-H "User-Agent: ${userAgent}" \
-H 'Accept-Encoding: gzip' \
-X POST "${wikiApiUrl}?format=json&action=clientlogin" \
-X POST "${wikiApiUrl}?format=json&action=login" \
| gunzip \
> /dev/null

Expand Down
Loading