Skip to content

refs/heads/main b1681799ab023cdd0c71c48237a17078e7d17298 #1068

refs/heads/main b1681799ab023cdd0c71c48237a17078e7d17298

refs/heads/main b1681799ab023cdd0c71c48237a17078e7d17298 #1068

Workflow file for this run

name: main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup golang
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Test all
run: go test -v ./...
- name: Generate functions
env:
DEPLOYER_TOKEN: ${{secrets.GH_TOKEN}}
UPLOAD_FUNCSFILE_KEY: ${{secrets.UPLOAD_FUNCSFILE_KEY}}
run: |
echo "functions:" > /tmp/funcs.yaml
grep -o -R -i -E '"/blueapi\..*"' . | awk -F':' '{gsub(/"/, "", $2); print "-", substr($2, 2);}' | sort | uniq >> /tmp/funcs.yaml
cat /tmp/funcs.yaml
cd /tmp/ && git clone https://github.com/alphauslabs/blueapi-functions && cd blueapi-functions
cp -rv /tmp/funcs.yaml . && git status
git config user.email "dev@mobingi.com"
git config user.name "mobingideployer"
git add . && git commit -am "$GITHUB_REF $GITHUB_SHA" || true
git remote add origin-tmp https://$DEPLOYER_TOKEN@github.com/alphauslabs/blueapi-functions.git > /dev/null 2>&1
git push --set-upstream origin-tmp
curl -X POST -F "bluefns=@/tmp/funcs.yaml" https://api.alphaus.cloud/webhook/c27376a8-b868-4589-a287-5dab791fbb81/upbluefns?key=$UPLOAD_FUNCSFILE_KEY