This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,38 @@ | ||
name: Deploy to cloudtype | ||
name: Python Docker Host Runner | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
build: | ||
runs-on: [self-hosted, linux, x64] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Connect deploy key | ||
uses: cloudtype-github-actions/connect@v1 | ||
with: | ||
token: ${{ secrets.CLOUDTYPE_TOKEN }} | ||
ghtoken: ${{ secrets.GHP_TOKEN }} | ||
- name: Deploy | ||
uses: cloudtype-github-actions/deploy@v1 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
token: ${{ secrets.CLOUDTYPE_TOKEN }} | ||
project: dntjd1097/responsive-slack-bot | ||
stage: main | ||
yaml: > | ||
name: responsive-slack-bot | ||
python-version: 3.9 | ||
|
||
- name: Build Docker image | ||
run: sudo docker build -f Dockerfile -t notions_slack_bot_docker_image . | ||
working-directory: . | ||
|
||
app: [email protected] | ||
- name: Stop previous Docker container | ||
run: sudo docker stop notions_slack_bot_docker_container || true | ||
continue-on-error: true | ||
|
||
options: | ||
env: | ||
- name: FLASK_ENV | ||
value: production | ||
- name: SLACK_BOT_TOKEN | ||
value: ${{ secrets.SLACK_BOT_TOKEN }} | ||
- name: SLACK_APP_TOKEN | ||
value: ${{ secrets.SLACK_APP_TOKEN }} | ||
start: python slack.py | ||
context: | ||
git: | ||
url: [email protected]:${{ github.repository }}.git | ||
ref: ${{ github.ref }} | ||
- name: Remove previous Docker container | ||
run: sudo docker rm notions_slack_bot_docker_container || true | ||
continue-on-error: true | ||
- name: Run Docker container | ||
run: | | ||
sudo docker run -d --name notions_slack_bot_docker_container \ | ||
-e SLACK_APP_TOKEN=${{ secrets.SLACK_APP_TOKEN }} \ | ||
-e SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }} \ | ||
notions_slack_bot_docker_image |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM python:3.9.7 | ||
WORKDIR /app | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
COPY . . | ||
CMD ["python", "slack.py"] |