Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
burnt-exe authored Jun 1, 2024
1 parent 36361be commit bed60c2
Showing 1 changed file with 0 additions and 265 deletions.
265 changes: 0 additions & 265 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,274 +12,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
<<<<<<< HEAD
=======

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Create directories for course
run: |
mkdir -p course-materials/lectures
mkdir -p course-materials/exercises
mkdir -p course-materials/resources
mkdir -p practical-lab-work
mkdir -p web-portal
mkdir -p web-portal/css
mkdir -p web-portal/js
mkdir -p web-portal/assets
- name: Verify directory structure
run: |
ls -la course-materials
ls -la course-materials/lectures
ls -la course-materials/exercises
ls -la course-materials/resources
ls -la practical-lab-work
ls -la web-portal
- name: Create initial course files
run: |
echo "# Lectures" > course-materials/lectures/README.md
echo "# Exercises" > course-materials/exercises/README.md
echo "# Resources" > course-materials/resources/README.md
echo "# Practical Lab Work" > practical-lab-work/README.md
echo '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mobile App Development for Juniors</title>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css">
<script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-firestore.js"></script>
</head>
<body>
<header>
<h1>Mobile App Development for Juniors</h1>
<h2>Course Code: MADJ101</h2>
<h3>Building Foundational Skills for Future App Developers</h3>
</header>
<nav>
<ul>
<li><a href="lectures.html">Lectures</a></li>
<li><a href="exercises.html">Exercises</a></li>
<li><a href="resources.html">Resources</a></li>
<li><a href="practical-lab.html">Practical Lab Work</a></li>
</ul>
</nav>
<main>
<section id="content">
<h2>Welcome to the Course Portal</h2>
<p>Navigate through the sections to access course materials and lab exercises.</p>
<div id="auth-container">
<div id="login-form">
<h3>Login</h3>
<input type="email" id="login-email" placeholder="Email">
<input type="password" id="login-password" placeholder="Password">
<button onclick="login()">Login</button>
</div>
<div id="register-form">
<h3>Register</h3>
<input type="email" id="register-email" placeholder="Email">
<input type="password" id="register-password" placeholder="Password">
<button onclick="register()">Register</button>
</div>
</div>
</section>
</main>
<footer>
<p>&copy; 2024 Skunkworks (Pty) Ltd. All rights reserved.</p>
</footer>
<script src="js/scripts.js"></script>
</body>
</html>' > web-portal/index.html

- name: Create CSS file
run: |
echo '/* CSS styles for the course portal */
body {
font-family: "IBM Plex Sans", sans-serif;
background-color: #f4f4f9;
color: #333;
margin: 0;
padding: 0;
}
header {
background-color: #1a73e8;
color: white;
text-align: center;
padding: 20px 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
header h1 {
font-size: 2.5em;
margin: 0.2em 0;
font-weight: 700;
}
header h2 {
font-size: 1.2em;
margin: 0.2em 0;
font-weight: 400;
}
header h3 {
font-size: 1em;
margin: 0.2em 0;
font-weight: 400;
}
nav ul {
list-style: none;
padding: 0;
display: flex;
justify-content: center;
background-color: #1a73e8;
margin: 0;
}
nav ul li {
margin: 0 15px;
}
nav ul li a {
color: white;
text-decoration: none;
font-weight: 700;
}
nav ul li a:hover {
text-decoration: underline;
}
main {
padding: 20px;
}
footer {
text-align: center;
padding: 10px 0;
background-color: #1a73e8;
color: white;
position: fixed;
width: 100%;
bottom: 0;
}' > web-portal/css/styles.css

- name: Create JavaScript file
run: |
echo '// Firebase configuration
const firebaseConfig = {
apiKey: "YOUR_FIREBASE_API_KEY",
authDomain: "YOUR_FIREBASE_AUTH_DOMAIN",
projectId: "YOUR_FIREBASE_PROJECT_ID",
storageBucket: "YOUR_FIREBASE_STORAGE_BUCKET",
messagingSenderId: "YOUR_FIREBASE_MESSAGING_SENDER_ID",
appId: "YOUR_FIREBASE_APP_ID"
};

// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const auth = firebase.auth();
const db = firebase.firestore();

// Login function
function login() {
const email = document.getElementById("login-email").value;
const password = document.getElementById("login-password").value;
auth.signInWithEmailAndPassword(email, password)
.then((userCredential) => {
const user = userCredential.user;
alert("Login successful!");
// Redirect to course materials page or update UI accordingly
})
.catch((error) => {
alert("Login failed: " + error.message);
});
}
// Register function
function register() {
const email = document.getElementById("register-email").value;
const password = document.getElementById("register-password").value;
auth.createUserWithEmailAndPassword(email, password)
.then((userCredential) => {
const user = userCredential.user;
alert("Registration successful!");
// Save user data to Firestore
db.collection("users").doc(user.uid).set({
email: email,
progress: {
lectures: [],
exercises: [],
labWork: []
}
});
// Redirect to course materials page or update UI accordingly
})
.catch((error) => {
alert("Registration failed: " + error.message);
});
}
// Function to update progress
function updateProgress(section, item) {
const user = auth.currentUser;
if (user) {
const userDocRef = db.collection("users").doc(user.uid);
userDocRef.update({
["progress." + section]: firebase.firestore.FieldValue.arrayUnion(item)
}).then(() => {
alert("Progress updated!");
}).catch((error) => {
alert("Error updating progress: " + error.message);
});
} else {
alert("No user logged in!");
}
}

// Function to submit quiz
function submitQuiz() {
const user = auth.currentUser;
if (user) {
const form = document.getElementById("quiz-form");
const answers = {
question1: form.elements["question1"].value,
question2: form.elements["question2"].value
};
db.collection("users").doc(user.uid).collection("assessments").add({
quiz: answers,
timestamp: firebase.firestore.FieldValue.serverTimestamp()
}).then(() => {
alert("Quiz submitted!");
}).catch((error) => {
alert("Error submitting quiz: " + error.message);
});
} else {
alert("No user logged in!");
}' > web-portal/js/scripts.js
>>>>>>> 7d10d5baebe9d19c0e6d2a18fe434e7f03d33857

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web-portal
<<<<<<< HEAD
=======

- name: Create package.json if it does not exist
run: |
if [ ! -f package.json ]; then
echo '{
"name": "madj101",
"version": "1.0.0",
"description": "Mobile App Development for Juniors",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Raydo Matthee",
"license": "ISC",
"dependencies": {}
}' > package.json
fi
>>>>>>> 7d10d5baebe9d19c0e6d2a18fe434e7f03d33857

0 comments on commit bed60c2

Please sign in to comment.