Skip to content

Commit

Permalink
Setup CD
Browse files Browse the repository at this point in the history
  • Loading branch information
Tina-otoge committed Apr 11, 2024
1 parent bd32d5a commit b7cd19b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Clone Ansible
uses: actions/checkout@v2
with:
repository: Tina-otoge/infra
ref: master
- name: Install dependencies
run: |
pip install -U pip
pip install -r requirements.txt
- name: Save SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Run Ansible
env:
ANSIBLE_HOST_KEY_CHECKING: false
run: |
ansible-playbook -l ${{ secrets.DEPLOY_HOST }} playbooks/deploy/mechadon.yml -e "deploy_version=${{ github.sha }}" -e "deploy_user=${{ secrets.DEPLOY_USER }}" -u ${{ secrets.DEPLOY_LOGIN_USER }}
4 changes: 4 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash

# git pull
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
python -m mechadon

0 comments on commit b7cd19b

Please sign in to comment.