diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..042481d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,27 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: npm install + - name: Build your website + run: npm start + - name: Copy files to deploy branch + run: | + mkdir -p public + cp -r ./* public + - name: Commit and push to deploy branch + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add -A + git commit -m "Deploy to GitHub Pages" + git push origin HEAD:deploy diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml deleted file mode 100644 index 15a61d6..0000000 --- a/.github/workflows/github-actions.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/.gitignore b/.gitignore index e072899..1e5ebc0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules/ .env bckelleyResume.docx -app.js -package* \ No newline at end of file +package-* \ No newline at end of file diff --git a/app.js b/app.js new file mode 100644 index 0000000..e52c05a --- /dev/null +++ b/app.js @@ -0,0 +1,20 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const dotenv = require('dotenv'); +const app = express(); + +dotenv.config(); +const port = process.env.PORT || 3000; + +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); +app.use(express.static('src')); + +// Routes for your application +app.get("/", (req, res) => { + res.sendFile(__dirname + '/src/html/index.html'); +}); + +app.listen(port, () => { + console.log(`Server is running on port ${port}`); +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..ca724d7 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "terminal-portfolio", + "version": "1.0.0", + "main": "app.js", + "scripts": { + "start": "node app.js" + }, + "keywords": [], + "author": "bckelley", + "repository": { + "directory": "", + "type": "", + "url": "https://github.com/bckelley/terminal-portfolio" + }, + "license": "CC BY-NC-ND-4.0", + "description": "", + "dependencies": { + "body-parser": "^1.20.3", + "dotenv": "^16.4.5", + "express": "^4.21.1", + "gh-pages": "^6.2.0" + } +} diff --git a/src/html/favicon.ico b/src/favicon.ico similarity index 100% rename from src/html/favicon.ico rename to src/favicon.ico diff --git a/src/html/index.html b/src/index.html similarity index 100% rename from src/html/index.html rename to src/index.html