Skip to content

Commit fdd2176

Browse files
Update main.yml
1 parent 3d7ca1c commit fdd2176

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,7 @@ jobs:
2626
- name: Test SSH Connection
2727
run: |
2828
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "echo SSH Connection Successful"
29-
30-
- name: Create .env File
31-
uses: 'DamianReeves/write-file-action@master'
32-
with:
33-
path: ~/website-cms/.env
34-
write-mode: overwrite
35-
contents: ${{ secrets.ENV_FILE_CONTENT }}
36-
29+
3730
- name: Deploy to EC2
3831
run: |
3932
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF'
@@ -45,6 +38,8 @@ jobs:
4538
sudo chmod -R u+rwX ~/website-cms
4639
git config --global --add safe.directory "$(pwd)"
4740
git pull origin main
48-
41+
cat << 'EOT' > .env
42+
${{ secrets.ENV_FILE_CONTENT }}
43+
EOT
4944
docker compose up -d --build
5045
EOF

0 commit comments

Comments
 (0)