tldtest.net/.github/workflows/deployment.yml
Arnold Dechamps a49f459a5b
Updating workflows (#47)
* updating workflows

* another test for deployment workflow

* making the workflows more polished

* udpating again
2024-05-11 02:54:56 +02:00

54 lines
1.4 KiB
YAML

name: Master Workflow
on:
push:
branches:
- master
jobs:
deploy_after_master_push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Python 3.11 for Flake8
uses: actions/setup-python@v3
with:
python-version: "3.11"
# Other steps for linting with Flake8
- name: Set up Python 3.11 for Django
uses: actions/setup-python@v3
with:
python-version: "3.11"
# Other steps for running tests with Django
- name: Configure SSH for Deployment
if: success()
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
- name: Deploy to Production
if: success() && github.ref == 'refs/heads/master'
run: |
ssh target "cd tldtest && git pull origin master && docker-compose down && docker-compose up --build -d"
# Other steps for deploying static content to GitHub Pages