Add check github actions workflow #42
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 | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Load SSH key | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$SSH_KEY" > ~/.ssh/server.key | |
chmod 600 ~/.ssh/server.key | |
env: | |
SSH_KEY: ${{ secrets.SSH_KEY }} | |
- name: Install uv | |
run: curl -LsSf https://astral.sh/uv/0.5.4/install.sh | sh | |
- name: Run ansible | |
run: cd ansible/ && uv run ansible-playbook playbook.yaml --start-at-task="clone" | |
env: | |
ANSIBLE_HOST_KEY_CHECKING: False | |
ANSIBLE_PRIVATE_KEY_FILE: "~/.ssh/server.key" | |
ANSIBLE_HOST: ${{ vars.ANSIBLE_HOST }} | |
ANSIBLE_USER: ${{ vars.ANSIBLE_USER }} | |
DEBUG: ${{ vars.DEBUG }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} |