changed wording of bid intel page #290
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: Website Deployment | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleanup disk space | |
run: | | |
# Remove all unused Docker data (images, containers, volumes, and networks) | |
sudo docker system prune -af | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Set Target Directory | |
run: | | |
echo "TARGET_DIR=/home/ec2-user/website/" >> $GITHUB_ENV | |
- name: Run deploy | |
run: | | |
set -x # Enable command tracing | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
echo "${{ secrets.DEPLOYMENT_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -v 44.208.84.199 >> ~/.ssh/known_hosts | |
ssh -i ~/.ssh/id_rsa [email protected] "cd $TARGET_DIR/sparkai-chatbot-frontend/website && docker-compose down" | |
ssh -i ~/.ssh/id_rsa [email protected] "docker system prune -af" | |
rsync -avz --stats -e "ssh -v -i ~/.ssh/id_rsa" --exclude '.git' --exclude 'node_modules' . [email protected]:$TARGET_DIR/sparkai-chatbot-frontend | |
ssh -i ~/.ssh/id_rsa [email protected] "cd $TARGET_DIR/sparkai-chatbot-frontend/website && docker-compose build --no-cache && docker-compose up -d --force-recreate" |