General Update #12
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
#Please set repository secret to [TOKEN:youtdiscordtoken] and repository varable to [TOKEN:anything] | |
name: SimpleBotCI | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
jobs: | |
build-and-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Detect Token | |
if: ${{ vars.TOKEN == '' }} | |
run: echo "Please set the repository varable, Key is TOKEN and Value could be anything." | |
- name: Detect Token | |
env: | |
TOKEN2: ${{ secrets.TOKEN }} | |
if: ${{ vars.TOKEN != '' && env.TOKEN2 == ''}} | |
run: | | |
echo "Please also include your discord token as a repository secret with key TOKEN." | |
return 1 | |
- name: Checkout code | |
if: ${{ vars.TOKEN != '' }} | |
uses: actions/checkout@v4 | |
- name: Create secrets.json file from secrets | |
if: ${{ vars.TOKEN != '' }} | |
run: | | |
echo "{\"token\":\"${{ secrets.TOKEN }}\"}" > secrets.json | |
echo $GOOGLE > google_credentials.json | |
echo $CONFIG > config.json | |
env: | |
GOOGLE: ${{ secrets.GOOGLE }} | |
CONFIG: ${{ vars.CONFIG }} | |
- name: Pull submodule | |
if: ${{ vars.TOKEN != '' }} | |
run: | | |
git submodule update --init --recursive --remote | |
- name: Build Docker img | |
if: ${{ vars.TOKEN != '' }} | |
run: docker build -t botnobi . | |
- name: CI the bot for 15 min | |
if: ${{ vars.TOKEN != '' }} | |
timeout-minutes: 15 | |
run: docker run -t botnobi | |
continue-on-error: true |