Skip to content

feat: add redirects #35

feat: add redirects

feat: add redirects #35

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Deploy services
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
run: |
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST << 'EOF'
cd ~/etips
docker image prune -af
git pull origin main
sops -d vars.env > .env
sudo docker compose pull
sudo docker compose build etips
sudo docker compose up -d
EOF
# - name: Set up SSH
# uses: webfactory/ssh-agent@v0.5.3
# with:
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
#
# - name: Deploy services
# env:
# SSH_USER: ${{ secrets.SSH_USER }}
# SSH_HOST: ${{ secrets.SSH_HOST }}
# run: |
# ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST << 'EOF'
# cd ~/etips
# git pull origin main
# sops -d vars.env > .env
# docker-compose pull
# docker-compose up -d --build
# EOF