Add deploy config (#4)

Co-authored-by: Mikołaj Pich <m.pich@outlook.com>
This commit is contained in:
doteq 2022-12-02 22:32:55 +01:00 committed by GitHub
parent 52372b26a2
commit e00f7b07be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 0 deletions

24
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Deploy to Oracle Cloud
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
environment: oracle-cloud
steps:
- uses: actions/checkout@v2
- name: Create .env file
uses: SpicyPizza/create-envfile@v1
with:
envkey_API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
envkey_DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
- uses: alex-ac/github-action-ssh-docker-compose@master
name: Docker-Compose Remote Deployment
with:
ssh_host: ${{ secrets.CLOUD_SSH_HOST }}
ssh_private_key: ${{ secrets.CLOUD_SSH_PRIVATE_KEY }}
ssh_user: ${{ secrets.CLOUD_SSH_USER }}
docker_compose_prefix: bot

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM python:3.11-alpine
ENV POETRY_VERSION=1.2.0
ENV PYTHONUNBUFFERED=1
RUN apk add gcc libressl-dev libffi-dev python3-dev musl-dev
RUN pip install "poetry==$POETRY_VERSION"
WORKDIR /app
COPY poetry.lock pyproject.toml /app/
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root
COPY . .
CMD [ "poetry", "run", "python", "-m", "wulkabot" ]

4
docker-compose.yaml Normal file
View file

@ -0,0 +1,4 @@
version: "3.5"
services:
bot:
build: .