chore: lint and use Rye and bump version to 1.5.5 #24
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: Deploy to prod when tag | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
deploy-prod: | |
name: Deploy to prod from ${{ github.ref_name }}/${{ github.sha }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
name: id_rsa | |
known_hosts: ${{ secrets.SSH_HOST }} | |
- name: Adding known hosts | |
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Copy repository to server with rsync | |
run: rsync -avz --exclude '.git' --chown=github:www-data --chmod=Dg=rwx,Fg=rwx ./ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/www/word-generator-api/ # We set directory (D) and files (F) permission for group www-data to rwx so that the same users can overwrite later | |
- name: Execute server commands for deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/www/word-generator-api | |
source /home/www/word-generator-api/.venv/bin/activate | |
pip install -r /home/www/word-generator-api/requirements.lock | |
sudo systemctl restart word-generator-api.service | |
- name: Create Sentry release | |
uses: getsentry/[email protected] | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: "adrien-carpentier" | |
SENTRY_PROJECT: "word-generator-api" | |
with: | |
environment: production | |
version: ${{ github.ref_name }} |