mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-15 17:19:10 +00:00
feat: Slash Commands (#337)
* feat: add discord interactions worker * feat(interactions): update CI/CD and terraform to add interactions * chore: fix lint issues * chore: fix build & emulation * fix(interactions): deployment + handler * chore: remove worker-dist via gitignore * feat: add /pickable-roles and /pick-role basis * feat: add pick, remove, and update the general /roleypoly command * fix: lint missing Member import
This commit is contained in:
parent
dde05c402e
commit
066f68ffef
59 changed files with 1219 additions and 248 deletions
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
|
@ -38,6 +38,11 @@ jobs:
|
|||
name: Worker Build & Publish
|
||||
needs:
|
||||
- node_test
|
||||
strategy:
|
||||
matrix:
|
||||
worker:
|
||||
- api
|
||||
- interactions
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
|
@ -55,7 +60,7 @@ jobs:
|
|||
- name: Check if already deployed
|
||||
id: check
|
||||
run: |
|
||||
gsutil stat gs://roleypoly-artifacts/backend-worker/${{ github.sha }}/script.js \
|
||||
gsutil stat gs://roleypoly-artifacts/workers/${{ github.sha }}/${{ matrix.worker }}.js \
|
||||
&& echo ::set-output name=skip::1 \
|
||||
|| echo ::set-output name=skip::0
|
||||
|
||||
|
@ -81,16 +86,17 @@ jobs:
|
|||
|
||||
- run: |
|
||||
wrangler init
|
||||
echo 'webpack_config = "packages/api/webpack.config.js"' | tee -a wrangler.toml
|
||||
echo 'webpack_config = "packages/${{ matrix.worker }}/webpack.config.js"' | tee -a wrangler.toml
|
||||
wrangler build
|
||||
mv worker/script.js worker/${{ matrix.worker }}.js
|
||||
if: steps.check.outputs.skip == '0'
|
||||
|
||||
- id: upload-file
|
||||
if: github.event_name == 'push' && steps.check.outputs.skip == '0'
|
||||
uses: google-github-actions/upload-cloud-storage@main
|
||||
with:
|
||||
path: worker/script.js
|
||||
destination: roleypoly-artifacts/backend-worker/${{ github.sha }}
|
||||
path: worker/${{ matrix.worker }}.js
|
||||
destination: roleypoly-artifacts/workers/${{ github.sha }}
|
||||
credentials: ${{ secrets.GCS_TF_KEY }}
|
||||
|
||||
docker_build:
|
||||
|
|
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
|
@ -49,7 +49,7 @@ jobs:
|
|||
selected="${targetArtifact:-$currentHash}"
|
||||
|
||||
mkdir worker-dist
|
||||
gsutil cp gs://roleypoly-artifacts/backend-worker/$selected/script.js worker-dist/backend-worker.js
|
||||
gsutil cp -r "gs://roleypoly-artifacts/workers/$selected/*" worker-dist/
|
||||
|
||||
- name: Terraform init
|
||||
working-directory: ./terraform
|
||||
|
@ -60,7 +60,7 @@ jobs:
|
|||
working-directory: ./terraform
|
||||
run: |
|
||||
echo \
|
||||
'{"bot_tag": "${{github.event.inputs.bot_tag}}", "api_path_to_worker": "./worker-dist/backend-worker.js"}' \
|
||||
'{"bot_tag": "${{github.event.inputs.bot_tag}}", "worker_tag": "${{github.event.inputs.worker_tag}}", "api_path_to_worker": "./worker-dist/api.js", "interactions_path_to_worker": "./worker-dist/interactions.js"}' \
|
||||
| jq . \
|
||||
| tee tags.auto.tfvars.json
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue