+
Date: Thu, 23 Jan 2025 15:09:47 -0700
Subject: [PATCH 4/5] CI/CD setup
---
.github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 .github/workflows/main.yml
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 00000000..dbe9dbdf
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,36 @@
+name: Deploy Portfolio
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the main branch
+ push:
+ branches: [ main ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ # This workflow contains a single job called "build"
+ deploy:
+ # The type of runner that the job will run on
+ runs-on: ubuntu-latest
+
+ # Steps represent a sequence of tasks that will be executed as part of the job
+ steps:
+
+ # Saves the private key and adds your server to the list of known hosts
+ - name: SSH Setup
+ run: |
+ mkdir -p ~/.ssh/
+ echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
+ sudo chmod 600 ~/.ssh/id_rsa
+ echo "$SSH_HOST_THUMBPRINT" > ~/.ssh/known_hosts
+ shell: bash
+ env:
+ SSH_PRIVATE_KEY: ${{secrets.DBP_LOGIN_KEY}}
+ SSH_HOST_THUMBPRINT: ${{secrets.DBP_THUMBPRINT}}
+
+ # Connects to your server via ssh and runs the deploy bash script
+ - name: Run Deploy Script
+ run: ssh -i ~/.ssh/id_rsa prod@${{secrets.IP_ADDRESS}} sh portfolio-deploy.sh
From 01af8385ee399b4cad7923ae00503d03452dbf61 Mon Sep 17 00:00:00 2001
From: Josh Ashton
Date: Thu, 23 Jan 2025 22:12:52 +0000
Subject: [PATCH 5/5] updating .gitignore
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 2bd18039..04d53208 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.env
+log.txt
# Logs
logs