Lock seed rolling by default #289
Workflow file for this run
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install flake8 | |
run: pip install flake8 | |
- name: Run flake8 | |
run: flake8 | |
- name: Install requirements | |
run: pip install -e . | |
- name: Run tests | |
run: python -m unittest discover -s randobot/tests -p 'test_*.py' | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.repository == 'wooferzfg/tww-rando-bot' && github.ref == 'refs/heads/main' | |
concurrency: deploy | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@v3 | |
# For initial setup, launch an Amazon Linux 2 AMI instance and run the following commands: | |
# | |
# sudo yum install -y docker git | |
# sudo service docker start | |
# sudo usermod -aG docker ec2-user | |
# sudo curl -L "https://github.com/docker/compose/releases/download/1.29.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
# sudo chmod o+rwx /usr/local/bin/docker-compose | |
- name: Deploy using SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EC2_ADDRESS }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.EC2_RSA_KEY }} | |
script: | | |
docker stop $(docker ps -aq) || true | |
docker rm $(docker ps -aq) || true | |
docker system prune -f || true | |
sudo rm -r tww-rando-bot || true | |
git clone --recursive https://github.com/wooferzfg/tww-rando-bot.git | |
echo "${{ secrets.WWRANDO_SEED_KEY }}" > tww-rando-bot/wwrando/keys/seed_key.py | |
echo "${{ secrets.WWRANDO_DEV_TANJO3_SEED_KEY }}" > tww-rando-bot/wwrando-dev-tanjo3/keys/seed_key.py | |
echo "${{ secrets.WWRANDO_DEV_TANJO3_SEED_KEY }}" > tww-rando-bot/wwrando-random-settings/keys/seed_key.py | |
cd tww-rando-bot | |
docker-compose build --no-cache | |
export GITHUB_TOKEN=${{ secrets.BOT_GITHUB_TOKEN }} | |
export CLIENT_ID=${{ secrets.RACETIME_CLIENT_ID }} | |
export CLIENT_SECRET=${{ secrets.RACETIME_CLIENT_SECRET }} | |
docker-compose up -d |