Skip to content

Commit

Permalink
Updated Workflows (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
altf4arnold authored May 11, 2024
1 parent a9be693 commit f5e9b5e
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 141 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/deploy.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploying

on:
workflow_run:
workflows: ["Deploy", "Deploy static content to Pages"]
branches:
- master
types:
- completed

jobs:
deploy_after_master_push:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Deploy via SSH
if: github.event.workflow_run.name == 'Deploy'
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/github
chmod 600 ~/.ssh/github
cat >>~/.ssh/config <<END
Host target
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/github
LogLevel ERROR
StrictHostKeyChecking no
END
ssh target "cd tldtest && git pull origin master && docker-compose down && docker-compose up --build -d"
- name: Deploy static content to GitHub Pages
if: github.event.workflow_run.name == 'Deploy static content to Pages'
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_commit.sha }}
- name: Deploy static content to Pages
if: github.event.workflow_run.name == 'Deploy static content to Pages'
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
31 changes: 0 additions & 31 deletions .github/workflows/django.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/flake.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Django test and Flake 8

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11 for Flake8
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install Flake8
run: |
pip install flake8
- name: Lint with Flake8
run: |
flake8 --ignore=E501,F401,E402,F811,E731,F403,E722 .
django:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} for Django
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies for Django
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
cp config.example.py config.py
- name: Run Tests for Django
run: |
python manage.py test
43 changes: 0 additions & 43 deletions .github/workflows/static.yml

This file was deleted.

0 comments on commit f5e9b5e

Please sign in to comment.