Skip to content

Merge pull request #8 from Jernik/dev-filters #62

Merge pull request #8 from Jernik/dev-filters

Merge pull request #8 from Jernik/dev-filters #62

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy-configs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: prod
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: bash script
run: |
for filename in Splitmod/*.yaml
do
echo "Processing $filename"
raw_config=$(cat $filename)
guild_id="$(basename $filename .yaml)"
endpoint_url="https://api.jernik.me/guilds/$guild_id/config"
jq -n --arg raw_config "$raw_config" '{config:$raw_config}' > ${guild_id}.json
curl --fail -X POST -H "Content-Type:application/json" -H "X-Api-Key:${{ secrets.zeppelin_apikey }}" --data @${guild_id}.json $endpoint_url
done