Git EC2 Deploy #29
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: Git EC2 Deploy | |
on: | |
# push: | |
# branches: | |
# - incention-develop | |
workflow_dispatch: | |
jobs: | |
build-and-release: | |
environment: development-twitter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
scripts/build-ec2-atlas-twitter-agent.sh | |
sparse-checkout-cone-mode: false | |
- name: Setup ENV File | |
run: | | |
cat << 'EOF' > .env | |
${{ secrets.ENV_FILE }} | |
EOF | |
- name: Copy EC2 build script | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.EC2_PRIVATE_KEY }} | |
source: scripts/build-ec2-atlas-twitter-agent.sh | |
target: /home/${{ secrets.EC2_USERNAME }}/ | |
- name: Copy .env file to EC2 Instance | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.EC2_PRIVATE_KEY }} | |
source: .env | |
target: /home/${{ secrets.EC2_USERNAME }}/eliza/ | |
- name: Deploy to EC2 instance | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.EC2_PRIVATE_KEY }} | |
script: source ~/.zshrc && zsh ~/scripts/build-ec2-atlas-twitter-agent.sh |