setup github actions for deploy

This commit is contained in:
bckelley
2024-10-31 15:54:01 -05:00
parent 27c3767512
commit 6a7da746c5
7 changed files with 71 additions and 20 deletions
+27
View File
@@ -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
-18
View File
@@ -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 }}."
+1 -2
View File
@@ -1,5 +1,4 @@
node_modules/
.env
bckelleyResume.docx
app.js
package*
package-*
+20
View File
@@ -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}`);
})
+23
View File
@@ -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"
}
}

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB