-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.44 KB
/
git-ec2-twitter-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Git EC2 Twitter Deploy
on:
# push:
# branches:
# - 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 }}/atlas/
- 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