From f2a086884f08b303495e42469656ba3ec3c5370e Mon Sep 17 00:00:00 2001 From: mkendal9 Date: Mon, 31 Mar 2025 17:41:22 -0500 Subject: [PATCH 01/45] First Commit --- Code/02 Basics/01 First Workflow/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/02 Basics/01 First Workflow/README.md b/Code/02 Basics/01 First Workflow/README.md index 56af5a03..9a89d1c5 100644 --- a/Code/02 Basics/01 First Workflow/README.md +++ b/Code/02 Basics/01 First Workflow/README.md @@ -1,3 +1,4 @@ # Getting Started with GitHub Actions -This repository will be used to get started with GitHub Actions! \ No newline at end of file +This repository will be used to get started with GitHub Actions! +Let's Test \ No newline at end of file From be1e543c02e4a53502924f0d900297cf4ebdf805 Mon Sep 17 00:00:00 2001 From: kendallmark3 Date: Mon, 31 Mar 2025 19:19:24 -0500 Subject: [PATCH 02/45] Update README.md --- Code/02 Basics/01 First Workflow/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/02 Basics/01 First Workflow/README.md b/Code/02 Basics/01 First Workflow/README.md index 9a89d1c5..59b71597 100644 --- a/Code/02 Basics/01 First Workflow/README.md +++ b/Code/02 Basics/01 First Workflow/README.md @@ -1,4 +1,4 @@ # Getting Started with GitHub Actions This repository will be used to get started with GitHub Actions! -Let's Test \ No newline at end of file +Let's Test ok From b1036d6926f2ba6bc1e1c0d143e7a8742d575206 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:14:22 -0500 Subject: [PATCH 03/45] readme.md --- .../.github/workflows/readme.md | 297 ++++++++++++++++++ 1 file changed, 297 insertions(+) create mode 100644 Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md new file mode 100644 index 00000000..a1448f9c --- /dev/null +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md @@ -0,0 +1,297 @@ +# Getting Started with GitHub Actions + +GitHub Actions is a powerful automation platform that allows you to automate, customize, and execute your software development workflows right in your repository. You can build, test, and deploy your code directly from GitHub, or integrate with a variety of third-party services. + +This `README.md` will guide you through the basics of GitHub Actions, providing a foundation for creating your own automated workflows. + +## Table of Contents + +1. [What are GitHub Actions?](#what-are-github-actions) +2. [Core Concepts](#core-concepts) + * [Workflows](#workflows) + * [Events](#events) + * [Jobs](#jobs) + * [Steps](#steps) + * [Actions](#actions) + * [Runners](#runners) +3. [Getting Started: Your First Workflow](#getting-started-your-first-workflow) + * [Workflow File Location](#workflow-file-location) + * [Basic Workflow Structure](#basic-workflow-structure) +4. [Common Commands and Tips](#common-commands-and-tips) + * [Viewing Workflow Runs](#viewing-workflow-runs) + * [Debugging Workflows](#debugging-workflows) + * [Skipping Workflow Runs](#skipping-workflow-runs) + * [Secrets](#secrets) +5. [Sample Workflow: React App CI/CD](#sample-workflow-react-app-cicd) + * [Prerequisites](#prerequisites) + * [Workflow Explained](#workflow-explained) +6. [Further Learning](#further-learning) + +--- + +## What are GitHub Actions? + +GitHub Actions enable you to define custom workflows that automatically execute a series of commands when specific events occur in your GitHub repository. These events can range from a `push` to a branch, a `pull_request` being opened, a `release` being published, or even a scheduled `cron` job. + +## Core Concepts + +Understanding these core concepts is crucial for effectively using GitHub Actions: + +### Workflows + +A workflow is an automated, configurable process that runs one or more jobs. Workflows are defined in YAML files (`.yml` or `.yaml`) within the `.github/workflows/` directory of your repository. + +### Events + +An event is a specific activity in your repository that triggers a workflow run. Common events include: + +* `push`: When code is pushed to a branch. +* `pull_request`: When a pull request is opened, synchronized, or closed. +* `workflow_dispatch`: Manually trigger a workflow from the GitHub UI or API. +* `schedule`: Run a workflow at a scheduled time using `cron` syntax. + +### Jobs + +A job is a set of steps that execute on the same runner. Each job runs in a fresh instance of the virtual environment. Jobs can run in parallel or sequentially, and dependencies between jobs can be defined. + +### Steps + +A step is an individual task within a job. Steps can be a script (a set of commands) or an action (a reusable unit of code). Steps are executed in the order they are defined. + +### Actions + +Actions are the fundamental building blocks of a workflow. They are reusable units of code that can perform complex tasks without you having to write a lot of code. Actions can be: + +* **Community-created:** Available on the GitHub Marketplace. +* **Locally-defined:** Custom actions you create within your repository. +* **Docker container actions:** Actions packaged as Docker containers. + +### Runners + +A runner is a server that has the GitHub Actions runner application installed. It listens for available jobs, runs them, and reports the progress and results back to GitHub. GitHub provides Ubuntu, Windows, and macOS virtual machines as hosted runners, or you can host your own self-hosted runners. + +--- + +## Getting Started: Your First Workflow + +Let's create a simple workflow that triggers on a `push` and prints "Hello, GitHub Actions!" to the console. + +### Workflow File Location + +All workflow files must be placed in the `.github/workflows/` directory at the root of your repository. + +### Basic Workflow Structure + +1. **Create the directory:** + ```bash + mkdir -p .github/workflows + ``` + +2. **Create a new file:** `.github/workflows/hello-world.yml` + +3. **Add the following content:** + + ```yaml + # .github/workflows/hello-world.yml + name: Hello World Workflow + + on: [push] # This workflow runs on every push to any branch + + jobs: + build: # This is the ID of our job + runs-on: ubuntu-latest # Specify the runner environment + + steps: + - name: Checkout code + uses: actions/checkout@v4 # An action to check out your repository's code + + - name: Greet + run: echo "Hello, GitHub Actions!" # A simple script step + ``` + +4. **Commit and Push:** + ```bash + git add .github/workflows/hello-world.yml + git commit -m "Add hello world workflow" + git push + ``` + +Now, navigate to your repository on GitHub, click on the "Actions" tab, and you should see your "Hello World Workflow" running! + +--- + +## Common Commands and Tips + +While there aren't "commands" in the traditional sense for GitHub Actions (they are defined in YAML), here are some tips for managing and interacting with your workflows: + +### Viewing Workflow Runs + +* Go to your repository on GitHub. +* Click on the **"Actions"** tab. +* You'll see a list of all workflow runs. Click on a specific run to view its details, including jobs, steps, and logs. + +### Debugging Workflows + +* **Review Logs:** The most crucial debugging tool. The logs for each step will show you exactly what happened during execution. Look for error messages. +* **Increase Verbosity:** For JavaScript actions, you can set the `ACTIONS_STEP_DEBUG` secret to `true` to enable step debugging logs. +* **Local Testing (act):** For more complex scenarios, consider using tools like `act` (https://github.com/nektos/act) to run your workflows locally before pushing to GitHub. +* **`continue-on-error`:** You can add `continue-on-error: true` to a step to allow a job to continue even if that step fails. This is useful for debugging. + +### Skipping Workflow Runs + +You can conditionally skip workflow runs or individual jobs using `if` conditions in your workflow file. + +Example: Only run on `main` branch pushes: + +```yaml +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + # ... +Example: Skip a job if a specific file hasn't changed: + +YAML + +jobs: + my-job: + if: contains(github.event.head_commit.modified, 'my-specific-file.js') + runs-on: ubuntu-latest + steps: + # ... +Secrets +Sensitive information (like API keys, tokens, or passwords) should never be hardcoded in your workflow files. GitHub Actions provides a secure way to store and access secrets: + +Go to your repository on GitHub. + +Click on "Settings". + +In the left sidebar, click on "Secrets and variables" > "Actions". + +Click "New repository secret". + +Give your secret a Name (e.g., MY_API_KEY) and its Value. + +You can then access this secret in your workflow using the secrets context: + +YAML + +steps: + - name: Use a secret + run: echo "The API Key is: ${{ secrets.MY_API_KEY }}" +Sample Workflow: React App CI/CD +This sample workflow demonstrates a common CI/CD pipeline for a React application. It will: + +Trigger on push to the main branch. +Install dependencies. +Run tests. +Build the React application. +(Optional) Deploy to GitHub Pages (requires additional setup for your package.json and a gh-pages branch). +Prerequisites +A React project (created with Create React App, Vite, etc.). +Ensure your package.json has test and build scripts defined. +If deploying to GitHub Pages, ensure your package.json has a homepage field pointing to your GitHub Pages URL (e.g., "homepage": "https://.github.io/") and the gh-pages package installed (npm install gh-pages --save-dev). +Workflow Explained +Create a new file: .github/workflows/react-ci-cd.yml + +YAML + +# .github/workflows/react-ci-cd.yml +name: React CI/CD Pipeline + +on: + push: + branches: + - main # Trigger on pushes to the main branch + +jobs: + build-and-test: + name: Build and Test React App + runs-on: ubuntu-latest # Use the latest Ubuntu runner + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 # Checkout the repository code + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' # Specify the Node.js version to use + + - name: Install Dependencies + run: npm install # Install project dependencies + + - name: Run Tests + run: npm test -- --watchAll=false # Run tests, disabling watch mode for CI + + - name: Build React App + run: npm run build # Build the production-ready React app + + - name: Upload Build Artifact (Optional) + uses: actions/upload-artifact@v4 + with: + name: react-build + path: build/ # Path to your built React app (usually 'build' or 'dist') + + # deploy-to-github-pages: # Uncomment this job to enable GitHub Pages deployment + # name: Deploy to GitHub Pages + # needs: build-and-test # This job depends on the 'build-and-test' job succeeding + # runs-on: ubuntu-latest + # if: success() # Only run if the previous job was successful + # + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v4 + # + # - name: Download Build Artifact + # uses: actions/download-artifact@v4 + # with: + # name: react-build + # path: build/ # Download the build artifact to this path + # + # - name: Deploy to GitHub Pages + # uses: peaceiris/actions-gh-pages@v4 # Action for deploying to gh-pages + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN is automatically provided + # publish_dir: ./build # Directory to publish + # force_orphan: true # Recommended for clean deployments + # cname: your-custom-domain.com # Uncomment and replace if you have a custom domain +To use the deploy-to-github-pages job: + +Uncomment the deploy-to-github-pages job in the .github/workflows/react-ci-cd.yml file. +Configure homepage in package.json: +JSON + +// package.json +{ + // ... + "homepage": "https://.github.io/", + "scripts": { + // ... + "predeploy": "npm run build", + "deploy": "gh-pages -d build" + } +} +Replace and with your actual GitHub username and repository name. +Install gh-pages: npm install gh-pages --save-dev +Ensure your repository has GitHub Pages enabled in its settings, pointing to the gh-pages branch. +Further Learning +GitHub Actions Documentation: The official and most comprehensive resource. +https://docs.github.com/en/actions +GitHub Marketplace: Discover thousands of actions created by the community. +https://github.com/marketplace?type=actions +Awesome GitHub Actions: A curated list of resources, actions, and tips. +https://github.com/sdras/awesome-actions +Start experimenting with different events, jobs, and actions to automate your development workflow and make your life easier! Happy automating! + + +Sources + + + + + From 0ba610d885e204fcedfd8529ee1f1b8e4ead53e0 Mon Sep 17 00:00:00 2001 From: kendallmark3 Date: Sat, 7 Jun 2025 08:25:33 -0500 Subject: [PATCH 04/45] Create main.yml --- .github/workflows/main.yml | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 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..f7b4df25 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,64 @@ +name: Deploy website +on: + push: + branches: + - main +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Get code + uses: actions/checkout@v3 + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + - name: Install dependencies + run: npm ci + - name: Lint code + run: npm run lint + - name: Test code + run: npm run test + build: + needs: test + runs-on: ubuntu-latest + outputs: + script-file: ${{ steps.publish.outputs.script-file }} + steps: + - name: Get code + uses: actions/checkout@v3 + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + - name: Install dependencies + run: npm ci + - name: Build website + run: npm run build + - name: Publish JS filename + id: publish + run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: dist-files + path: dist + # path: | + # dist + # package.json + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Get build artifacts + uses: actions/download-artifact@v3 + with: + name: dist-files + - name: Output contents + run: ls + - name: Output filename + run: echo "${{ needs.build.outputs.script-file }}" + - name: Deploy + run: echo "Deploying..." From 8964b3826635507e4861f8a22a97fa0de9853bdd Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:35:12 -0500 Subject: [PATCH 05/45] github --- .../03 Finished Project/.github/workflows/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md index a1448f9c..f3c0009e 100644 --- a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md @@ -291,6 +291,8 @@ Start experimenting with different events, jobs, and actions to automate your de Sources +main.yml is now ar root + From 09a9eb7c7122b7de8c782c5994040e541fdc670a Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:39:06 -0500 Subject: [PATCH 06/45] github --- .../03 Finished Project/.github/workflows/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md index f3c0009e..354f541d 100644 --- a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md @@ -291,7 +291,7 @@ Start experimenting with different events, jobs, and actions to automate your de Sources -main.yml is now ar root +main.yml is now ar root now working From 3555b813079008a4362e8240e3c25718dba9da8b Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:44:58 -0500 Subject: [PATCH 07/45] github --- .../03 Finished Project/.github/workflows/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md index 354f541d..edbeda74 100644 --- a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md @@ -291,7 +291,7 @@ Start experimenting with different events, jobs, and actions to automate your de Sources -main.yml is now ar root now working +main.yml is now ar root now working maybe From b2a103c8b42f0ab49a243c7749ed82c7c5ddddac Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:49:58 -0500 Subject: [PATCH 08/45] github --- .github/workflows/main.yml | 90 ++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7b4df25..d3cb7b42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,64 +1,106 @@ +# .github/workflows/deploy-website.yml name: Deploy website + on: push: branches: - - main + - main # This workflow runs when code is pushed to the main branch + jobs: test: runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this 'test' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project steps: - name: Get code - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Debug: List files in working directory + run: ls -la # Displays files in the current working directory to confirm package-lock.json is there + + - name: Debug: Print current working directory + run: pwd # Prints the full path of the current working directory + - name: Cache dependencies uses: actions/cache@v3 with: - path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + path: ~/.npm # Path to the directory to cache + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + - name: Install dependencies - run: npm ci + run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + - name: Lint code - run: npm run lint + run: npm run lint # Runs your project's lint script + - name: Test code - run: npm run test + run: npm run test # Runs your project's test script + build: - needs: test + needs: test # This job will only run after the 'test' job completes successfully runs-on: ubuntu-latest outputs: - script-file: ${{ steps.publish.outputs.script-file }} + script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename + # Define the default working directory for all 'run' commands in this 'build' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project steps: - name: Get code - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Debug: List files in working directory + run: ls -la # Displays files in the current working directory to confirm package-lock.json is there + + - name: Debug: Print current working directory + run: pwd # Prints the full path of the current working directory + - name: Cache dependencies uses: actions/cache@v3 with: path: ~/.npm key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + - name: Install dependencies - run: npm ci + run: npm ci # Installs dependencies + - name: Build website - run: npm run build + run: npm run build # Builds your website for production + # Note: The 'dist/' path here is relative to the working-directory set above. + # So, if your project builds to 'Code/04 Artifacts & Outputs/03 Finished Project/dist', + # then 'dist/' is correct. + - name: Publish JS filename - id: publish + id: publish # Gives this step an ID to reference its outputs + # Finds the generated JS file in 'dist/assets' and sets it as an output run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' + - name: Upload artifacts uses: actions/upload-artifact@v3 with: - name: dist-files - path: dist - # path: | - # dist - # package.json + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) + deploy: - needs: build + needs: build # This job will only run after the 'build' job completes successfully runs-on: ubuntu-latest steps: - name: Get build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact with: - name: dist-files + name: dist-files # Name of the artifact to download - name: Output contents - run: ls + run: ls # Lists the contents of the current directory (should show 'dist' files) - name: Output filename - run: echo "${{ needs.build.outputs.script-file }}" + run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job - name: Deploy - run: echo "Deploying..." + run: echo "Deploying the website..." # Placeholder for your deployment command + # Add your actual deployment commands here. + # Since 'dist-files' were downloaded to the current directory, + # you'll be operating from the root level of these downloaded files. + # For example, if using an action to deploy to a static host, you'd specify 'dist/' + # as the publish directory. \ No newline at end of file From c21704464a85099724c24ee1b2a726bb0193219d Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:53:13 -0500 Subject: [PATCH 09/45] github --- .../03 Finished Project/.github/workflows/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md index edbeda74..8d25305d 100644 --- a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md @@ -291,7 +291,7 @@ Start experimenting with different events, jobs, and actions to automate your de Sources -main.yml is now ar root now working maybe +main.yml is now ar root now working maybe 1 From 32f7420bfeaa526064044a2224850e94b9317267 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 08:59:43 -0500 Subject: [PATCH 10/45] github --- .github/workflows/main.yml | 67 +++++++++++--------------------------- 1 file changed, 19 insertions(+), 48 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3cb7b42..7be005bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,27 +43,24 @@ jobs: needs: test # This job will only run after the 'test' job completes successfully runs-on: ubuntu-latest outputs: - script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename - # Define the default working directory for all 'run' commands in this 'build' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project - steps: - - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code - - - name: Debug: List files in working directory - run: ls -la # Displays files in the current working directory to confirm package-lock.json is there - - - name: Debug: Print current working directory - run: pwd # Prints the full path of the current working directory - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + script-file: \{\{ steps\.publish\.outputs\.script\-file \}\} \# Outputs the generated JavaScript filename +\# Define the default working directory for all 'run' commands in this 'build' job\. +\# This assumes your package\.json, package\-lock\.json, etc\., are inside this directory\. +defaults\: +run\: +working\-directory\: '\./Code/04 Artifacts & Outputs/03 Finished Project' \# <\-\-\- Correct path for your project +steps\: +\- name\: Get code +uses\: actions/checkout@v3 \# Checks out your repository's code +\- name\: Debug\: List files in working directory +run\: ls \-la \# Displays files in the current working directory to confirm package\-lock\.json is there +\- name\: Debug\: Print current working directory +run\: pwd \# Prints the full path of the current working directory +\- name\: Cache dependencies +uses\: actions/cache@v3 +with\: +path\: \~/\.npm +key\: deps\-node\-modules\-{{ hashFiles('**/package-lock.json') }} - name: Install dependencies run: npm ci # Installs dependencies @@ -77,30 +74,4 @@ jobs: - name: Publish JS filename id: publish # Gives this step an ID to reference its outputs # Finds the generated JS file in 'dist/assets' and sets it as an output - run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: dist-files # Name for the uploaded artifact - path: dist # Path to the built files (relative to the working directory) - - deploy: - needs: build # This job will only run after the 'build' job completes successfully - runs-on: ubuntu-latest - steps: - - name: Get build artifacts - uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact - with: - name: dist-files # Name of the artifact to download - - name: Output contents - run: ls # Lists the contents of the current directory (should show 'dist' files) - - name: Output filename - run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job - - name: Deploy - run: echo "Deploying the website..." # Placeholder for your deployment command - # Add your actual deployment commands here. - # Since 'dist-files' were downloaded to the current directory, - # you'll be operating from the root level of these downloaded files. - # For example, if using an action to deploy to a static host, you'd specify 'dist/' - # as the publish directory. \ No newline at end of file + run: find dist/assets/*.js -type f -execdir echo 'script \ No newline at end of file From 17bb621da5523f83b95797e54e6c505eb6dbd5d7 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:02:06 -0500 Subject: [PATCH 11/45] github --- .../03 Finished Project/.github/workflows/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md index 8d25305d..966359b0 100644 --- a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/readme.md @@ -291,7 +291,7 @@ Start experimenting with different events, jobs, and actions to automate your de Sources -main.yml is now ar root now working maybe 1 +main.yml is now ar root now working maybe 2 From 333d4577282f3bf2bc9db7088459e57a69980fe5 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:06:02 -0500 Subject: [PATCH 12/45] github --- .github/workflows/main.yml | 67 +++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7be005bb..d3cb7b42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,24 +43,27 @@ jobs: needs: test # This job will only run after the 'test' job completes successfully runs-on: ubuntu-latest outputs: - script-file: \{\{ steps\.publish\.outputs\.script\-file \}\} \# Outputs the generated JavaScript filename -\# Define the default working directory for all 'run' commands in this 'build' job\. -\# This assumes your package\.json, package\-lock\.json, etc\., are inside this directory\. -defaults\: -run\: -working\-directory\: '\./Code/04 Artifacts & Outputs/03 Finished Project' \# <\-\-\- Correct path for your project -steps\: -\- name\: Get code -uses\: actions/checkout@v3 \# Checks out your repository's code -\- name\: Debug\: List files in working directory -run\: ls \-la \# Displays files in the current working directory to confirm package\-lock\.json is there -\- name\: Debug\: Print current working directory -run\: pwd \# Prints the full path of the current working directory -\- name\: Cache dependencies -uses\: actions/cache@v3 -with\: -path\: \~/\.npm -key\: deps\-node\-modules\-{{ hashFiles('**/package-lock.json') }} + script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename + # Define the default working directory for all 'run' commands in this 'build' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Debug: List files in working directory + run: ls -la # Displays files in the current working directory to confirm package-lock.json is there + + - name: Debug: Print current working directory + run: pwd # Prints the full path of the current working directory + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies run: npm ci # Installs dependencies @@ -74,4 +77,30 @@ key\: deps\-node\-modules\-{{ hashFiles('**/package-lock.json') }} - name: Publish JS filename id: publish # Gives this step an ID to reference its outputs # Finds the generated JS file in 'dist/assets' and sets it as an output - run: find dist/assets/*.js -type f -execdir echo 'script \ No newline at end of file + run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) + + deploy: + needs: build # This job will only run after the 'build' job completes successfully + runs-on: ubuntu-latest + steps: + - name: Get build artifacts + uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact + with: + name: dist-files # Name of the artifact to download + - name: Output contents + run: ls # Lists the contents of the current directory (should show 'dist' files) + - name: Output filename + run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job + - name: Deploy + run: echo "Deploying the website..." # Placeholder for your deployment command + # Add your actual deployment commands here. + # Since 'dist-files' were downloaded to the current directory, + # you'll be operating from the root level of these downloaded files. + # For example, if using an action to deploy to a static host, you'd specify 'dist/' + # as the publish directory. \ No newline at end of file From b0b6a635c8f173cd7f98c9ad8c896e81530d7665 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:08:13 -0500 Subject: [PATCH 13/45] github --- .github/workflows/main.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3cb7b42..d8f66941 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,12 +18,6 @@ jobs: - name: Get code uses: actions/checkout@v3 # Checks out your repository's code - - name: Debug: List files in working directory - run: ls -la # Displays files in the current working directory to confirm package-lock.json is there - - - name: Debug: Print current working directory - run: pwd # Prints the full path of the current working directory - - name: Cache dependencies uses: actions/cache@v3 with: @@ -53,12 +47,6 @@ jobs: - name: Get code uses: actions/checkout@v3 # Checks out your repository's code - - name: Debug: List files in working directory - run: ls -la # Displays files in the current working directory to confirm package-lock.json is there - - - name: Debug: Print current working directory - run: pwd # Prints the full path of the current working directory - - name: Cache dependencies uses: actions/cache@v3 with: From 37cbbf6517a27e37f87e7a5c56c2c52a61389dc7 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:12:55 -0500 Subject: [PATCH 14/45] github --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8f66941..76d9f491 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/deploy-website.yml +# .github/workflows/deploy-website.yml - Updated to trigger Git change name: Deploy website on: From 4a30da0474c6506430e21df119035d9d28c4386f Mon Sep 17 00:00:00 2001 From: kendallmark3 Date: Sat, 7 Jun 2025 09:15:38 -0500 Subject: [PATCH 15/45] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76d9f491..b9aed3a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/deploy-website.yml - Updated to trigger Git change +# .github/workflows/deploy-website.yml name: Deploy website on: @@ -91,4 +91,4 @@ jobs: # Since 'dist-files' were downloaded to the current directory, # you'll be operating from the root level of these downloaded files. # For example, if using an action to deploy to a static host, you'd specify 'dist/' - # as the publish directory. \ No newline at end of file + # as the publish directory. From 28d56415148daa696e2ab01edf8c2c35cc09562a Mon Sep 17 00:00:00 2001 From: kendallmark3 Date: Sat, 7 Jun 2025 09:18:58 -0500 Subject: [PATCH 16/45] Update main.yml --- .github/workflows/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9aed3a5..b59a6e1c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,9 +86,4 @@ jobs: - name: Output filename run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job - name: Deploy - run: echo "Deploying the website..." # Placeholder for your deployment command - # Add your actual deployment commands here. - # Since 'dist-files' were downloaded to the current directory, - # you'll be operating from the root level of these downloaded files. - # For example, if using an action to deploy to a static host, you'd specify 'dist/' - # as the publish directory. + run: echo "Deployment placeholder executed." From 416493e1eba01c8ded58358d8c570cf124ee8361 Mon Sep 17 00:00:00 2001 From: kendallmark3 Date: Sat, 7 Jun 2025 09:28:38 -0500 Subject: [PATCH 17/45] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b59a6e1c..4d9d2acf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,7 +60,7 @@ jobs: run: npm run build # Builds your website for production # Note: The 'dist/' path here is relative to the working-directory set above. # So, if your project builds to 'Code/04 Artifacts & Outputs/03 Finished Project/dist', - # then 'dist/' is correct. + # then 'dist/' is correct. again - name: Publish JS filename id: publish # Gives this step an ID to reference its outputs From 92240e0e064d2698466a1020926289271a229ee2 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:34:16 -0500 Subject: [PATCH 18/45] github --- .github/workflows/main.yml | 89 -------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 4d9d2acf..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,89 +0,0 @@ -# .github/workflows/deploy-website.yml -name: Deploy website - -on: - push: - branches: - - main # This workflow runs when code is pushed to the main branch - -jobs: - test: - runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands in this 'test' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project - steps: - - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm # Path to the directory to cache - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json - - - name: Install dependencies - run: npm ci # Installs dependencies from package-lock.json (requires it to be present) - - - name: Lint code - run: npm run lint # Runs your project's lint script - - - name: Test code - run: npm run test # Runs your project's test script - - build: - needs: test # This job will only run after the 'test' job completes successfully - runs-on: ubuntu-latest - outputs: - script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename - # Define the default working directory for all 'run' commands in this 'build' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project - steps: - - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - run: npm ci # Installs dependencies - - - name: Build website - run: npm run build # Builds your website for production - # Note: The 'dist/' path here is relative to the working-directory set above. - # So, if your project builds to 'Code/04 Artifacts & Outputs/03 Finished Project/dist', - # then 'dist/' is correct. again - - - name: Publish JS filename - id: publish # Gives this step an ID to reference its outputs - # Finds the generated JS file in 'dist/assets' and sets it as an output - run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: dist-files # Name for the uploaded artifact - path: dist # Path to the built files (relative to the working directory) - - deploy: - needs: build # This job will only run after the 'build' job completes successfully - runs-on: ubuntu-latest - steps: - - name: Get build artifacts - uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact - with: - name: dist-files # Name of the artifact to download - - name: Output contents - run: ls # Lists the contents of the current directory (should show 'dist' files) - - name: Output filename - run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job - - name: Deploy - run: echo "Deployment placeholder executed." From a72ec4e5621f2926d1078d4f01534543e9c5ac3c Mon Sep 17 00:00:00 2001 From: kendallmark3 Date: Sat, 7 Jun 2025 09:37:17 -0500 Subject: [PATCH 19/45] Create main.yml --- .github/workflows/main.yml | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 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..b59a6e1c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,89 @@ +# .github/workflows/deploy-website.yml +name: Deploy website + +on: + push: + branches: + - main # This workflow runs when code is pushed to the main branch + +jobs: + test: + runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this 'test' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm # Path to the directory to cache + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + + - name: Install dependencies + run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + + - name: Lint code + run: npm run lint # Runs your project's lint script + + - name: Test code + run: npm run test # Runs your project's test script + + build: + needs: test # This job will only run after the 'test' job completes successfully + runs-on: ubuntu-latest + outputs: + script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename + # Define the default working directory for all 'run' commands in this 'build' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + run: npm ci # Installs dependencies + + - name: Build website + run: npm run build # Builds your website for production + # Note: The 'dist/' path here is relative to the working-directory set above. + # So, if your project builds to 'Code/04 Artifacts & Outputs/03 Finished Project/dist', + # then 'dist/' is correct. + + - name: Publish JS filename + id: publish # Gives this step an ID to reference its outputs + # Finds the generated JS file in 'dist/assets' and sets it as an output + run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) + + deploy: + needs: build # This job will only run after the 'build' job completes successfully + runs-on: ubuntu-latest + steps: + - name: Get build artifacts + uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact + with: + name: dist-files # Name of the artifact to download + - name: Output contents + run: ls # Lists the contents of the current directory (should show 'dist' files) + - name: Output filename + run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job + - name: Deploy + run: echo "Deployment placeholder executed." From 5e917d514aadf97f23dcdd2b8ceab34b575bac31 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:44:06 -0500 Subject: [PATCH 20/45] github --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b59a6e1c..b4536ca6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,4 +86,4 @@ jobs: - name: Output filename run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job - name: Deploy - run: echo "Deployment placeholder executed." + run: echo "Deployment placeholder executed. now" From b39dff6dea8d108c29c13451f799d54f7806076a Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:47:12 -0500 Subject: [PATCH 21/45] github --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4536ca6..b7b6d434 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,7 +83,5 @@ jobs: name: dist-files # Name of the artifact to download - name: Output contents run: ls # Lists the contents of the current directory (should show 'dist' files) - - name: Output filename - run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job - name: Deploy - run: echo "Deployment placeholder executed. now" + run: echo "Deployment placeholder executed." \ No newline at end of file From 1223efe363ebd211531f6eb0eb5d1adbf165febc Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:49:45 -0500 Subject: [PATCH 22/45] github --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7b6d434..553b0670 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: dist-files # Name for the uploaded artifact path: dist # Path to the built files (relative to the working directory) From b8b0ced60eb3cdf9ff450b0d689c78ce485c17dc Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:51:25 -0500 Subject: [PATCH 23/45] github --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 553b0670..ac803b1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get build artifacts - uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact + uses: actions/download-artifact@v4 # Downloads the 'dist-files' artifact with: name: dist-files # Name of the artifact to download - name: Output contents From 2de450a88dbece19123165e35ff8d8ee00a2699e Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:56:05 -0500 Subject: [PATCH 24/45] github --- .github/workflows/main.yml | 92 ++++++++++++-------------------------- 1 file changed, 28 insertions(+), 64 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac803b1f..80d6a589 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,51 +1,14 @@ -# .github/workflows/deploy-website.yml -name: Deploy website - -on: - push: - branches: - - main # This workflow runs when code is pushed to the main branch - -jobs: - test: - runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands in this 'test' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project - steps: - - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm # Path to the directory to cache - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json - - - name: Install dependencies - run: npm ci # Installs dependencies from package-lock.json (requires it to be present) - - - name: Lint code - run: npm run lint # Runs your project's lint script - - - name: Test code - run: npm run test # Runs your project's test script - - build: - needs: test # This job will only run after the 'test' job completes successfully +build: + needs: test runs-on: ubuntu-latest outputs: - script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename - # Define the default working directory for all 'run' commands in this 'build' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. + script-file: ${{ steps.publish.outputs.script-file }} defaults: run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # This is where 'npm run build' runs from steps: - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code + uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v3 @@ -54,34 +17,35 @@ jobs: key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci # Installs dependencies + run: npm ci - name: Build website - run: npm run build # Builds your website for production - # Note: The 'dist/' path here is relative to the working-directory set above. - # So, if your project builds to 'Code/04 Artifacts & Outputs/03 Finished Project/dist', - # then 'dist/' is correct. + run: npm run build + + # --- ADD THESE NEW DEBUG STEPS HERE --- + - name: Debug: List files in working directory after build + run: | + echo "Listing contents of the current working directory:" + pwd # Print current working directory + ls -F # List files and directories, showing trailing slashes for dirs + echo "" + echo "Listing contents of 'dist' if it exists:" + ls -F dist/ || echo "dist directory does not exist or is empty" + echo "" + echo "Recursive listing from current working directory:" + ls -R + # --- END NEW DEBUG STEPS --- - name: Publish JS filename - id: publish # Gives this step an ID to reference its outputs - # Finds the generated JS file in 'dist/assets' and sets it as an output + id: publish run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: dist-files # Name for the uploaded artifact - path: dist # Path to the built files (relative to the working directory) - - deploy: - needs: build # This job will only run after the 'build' job completes successfully - runs-on: ubuntu-latest - steps: - - name: Get build artifacts - uses: actions/download-artifact@v4 # Downloads the 'dist-files' artifact - with: - name: dist-files # Name of the artifact to download - - name: Output contents - run: ls # Lists the contents of the current directory (should show 'dist' files) - - name: Deploy - run: echo "Deployment placeholder executed." \ No newline at end of file + name: dist-files + path: dist + if-no-files-found: warn + compression-level: 6 + overwrite: false + include-hidden-files: false \ No newline at end of file From 73bcbf6a3c4ad2db9e210d3a8579d7dfa9c9e17c Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 09:58:18 -0500 Subject: [PATCH 25/45] github --- .github/workflows/main.yml | 68 +++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80d6a589..5483ef1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,51 @@ -build: - needs: test +# .github/workflows/deploy-website.yml +name: Deploy website + +on: + push: + branches: + - main # This workflow runs when code is pushed to the main branch + +jobs: + test: + runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this 'test' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm # Path to the directory to cache + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + + - name: Install dependencies + run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + + - name: Lint code + run: npm run lint # Runs your project's lint script + + - name: Test code + run: npm run test # Runs your project's test script + + build: + needs: test # This job will only run after the 'test' job completes successfully runs-on: ubuntu-latest outputs: - script-file: ${{ steps.publish.outputs.script-file }} + script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename + # Define the default working directory for all 'run' commands in this 'build' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. defaults: run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # This is where 'npm run build' runs from + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project steps: - name: Get code - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Checks out your repository's code - name: Cache dependencies uses: actions/cache@v3 @@ -17,12 +54,12 @@ build: key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci + run: npm ci # Installs dependencies - name: Build website run: npm run build - # --- ADD THESE NEW DEBUG STEPS HERE --- + # --- DEBUG STEPS (KEEP THESE FOR NOW) --- - name: Debug: List files in working directory after build run: | echo "Listing contents of the current working directory:" @@ -34,7 +71,7 @@ build: echo "" echo "Recursive listing from current working directory:" ls -R - # --- END NEW DEBUG STEPS --- + # --- END DEBUG STEPS --- - name: Publish JS filename id: publish @@ -48,4 +85,17 @@ build: if-no-files-found: warn compression-level: 6 overwrite: false - include-hidden-files: false \ No newline at end of file + include-hidden-files: false + + deploy: + needs: build # This job will only run after the 'build' job completes successfully + runs-on: ubuntu-latest + steps: + - name: Get build artifacts + uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact + with: + name: dist-files # Name of the artifact to download + - name: Output contents + run: ls # Lists the contents of the current directory (should show 'dist' files) + - name: Deploy + run: echo "Deployment placeholder executed." \ No newline at end of file From 8bcfbaff29ab1b39f46d01b923bbbe2014922c9c Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:02:55 -0500 Subject: [PATCH 26/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5483ef1d..ad763825 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/deploy-website.yml +# .github/workflows/deploy-website.yml - Final clean attempt name: Deploy website on: From 598e0123c9ce31b9421679a4da94dd8b306de664 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:04:45 -0500 Subject: [PATCH 27/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad763825..117cc6be 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/deploy-website.yml - Final clean attempt +# .github/workflows/deploy-website.yml - Streamlined version name: Deploy website on: @@ -36,8 +36,7 @@ jobs: build: needs: test # This job will only run after the 'test' job completes successfully runs-on: ubuntu-latest - outputs: - script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename + # Removed 'outputs: script-file' as it's no longer needed without dynamic filename finding # Define the default working directory for all 'run' commands in this 'build' job. # This assumes your package.json, package-lock.json, etc., are inside this directory. defaults: @@ -73,15 +72,13 @@ jobs: ls -R # --- END DEBUG STEPS --- - - name: Publish JS filename - id: publish - run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' + # The 'Publish JS filename' step is removed as requested for simplicity. - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4 # Ensure this is v4 with: - name: dist-files - path: dist + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) if-no-files-found: warn compression-level: 6 overwrite: false From 39ac777e093ee91bd191766b1e864e47738ef51a Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:06:28 -0500 Subject: [PATCH 28/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 59 ++++++++++++-------------------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 117cc6be..64ef5ff0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/deploy-website.yml - Streamlined version +# .github/workflows/deploy-website.yml - Streamlined for core functionality name: Deploy website on: @@ -9,42 +9,37 @@ on: jobs: test: runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands in this 'test' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. defaults: run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code + uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v3 with: - path: ~/.npm # Path to the directory to cache - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + run: npm ci - name: Lint code - run: npm run lint # Runs your project's lint script + run: npm run lint - name: Test code - run: npm run test # Runs your project's test script + run: npm run test build: - needs: test # This job will only run after the 'test' job completes successfully + needs: test runs-on: ubuntu-latest - # Removed 'outputs: script-file' as it's no longer needed without dynamic filename finding - # Define the default working directory for all 'run' commands in this 'build' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. defaults: run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code + uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v3 @@ -53,46 +48,28 @@ jobs: key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci # Installs dependencies + run: npm ci - name: Build website run: npm run build - # --- DEBUG STEPS (KEEP THESE FOR NOW) --- - - name: Debug: List files in working directory after build - run: | - echo "Listing contents of the current working directory:" - pwd # Print current working directory - ls -F # List files and directories, showing trailing slashes for dirs - echo "" - echo "Listing contents of 'dist' if it exists:" - ls -F dist/ || echo "dist directory does not exist or is empty" - echo "" - echo "Recursive listing from current working directory:" - ls -R - # --- END DEBUG STEPS --- - - # The 'Publish JS filename' step is removed as requested for simplicity. - - name: Upload artifacts - uses: actions/upload-artifact@v4 # Ensure this is v4 + uses: actions/upload-artifact@v4 # Updated to v4 as per previous fix with: - name: dist-files # Name for the uploaded artifact - path: dist # Path to the built files (relative to the working directory) + name: dist-files + path: dist if-no-files-found: warn compression-level: 6 overwrite: false include-hidden-files: false deploy: - needs: build # This job will only run after the 'build' job completes successfully + needs: build runs-on: ubuntu-latest steps: - name: Get build artifacts - uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact + uses: actions/download-artifact@v3 with: - name: dist-files # Name of the artifact to download - - name: Output contents - run: ls # Lists the contents of the current directory (should show 'dist' files) + name: dist-files - name: Deploy run: echo "Deployment placeholder executed." \ No newline at end of file From e8da59d23c091c70eef6ff78052701fc8a063e01 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:10:13 -0500 Subject: [PATCH 29/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64ef5ff0..966fd050 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: dist-files - name: Deploy From 1d853b5941a7323c2e942d0f8d1b8aa934d73a85 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:15:24 -0500 Subject: [PATCH 30/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 966fd050..26c95fb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/deploy-website.yml - Streamlined for core functionality +# .github/workflows/deploy-website.yml - Streamlined for core functionality (with path debug) name: Deploy website on: @@ -53,11 +53,21 @@ jobs: - name: Build website run: npm run build + # --- NEW DEBUG STEP TO GET PATH --- + - name: Debug: Check 'dist' folder contents + run: | + echo "Current working directory (where 'dist' is expected to be):" + pwd + echo "" + echo "Contents of 'dist' folder:" + ls -F dist/ || echo "Error: 'dist' folder not found or is empty here!" + # --- END NEW DEBUG STEP --- + - name: Upload artifacts - uses: actions/upload-artifact@v4 # Updated to v4 as per previous fix + uses: actions/upload-artifact@v4 # Updated to v4 with: name: dist-files - path: dist + path: dist # Path to the built files (relative to the working directory) if-no-files-found: warn compression-level: 6 overwrite: false @@ -68,7 +78,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get build artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v4 # Updated to v4 with: name: dist-files - name: Deploy From 782645b736e485cc478de7d077ced3dc073b9ec1 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:22:00 -0500 Subject: [PATCH 31/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26c95fb7..823ad88a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ name: Deploy website on: push: branches: - - main # This workflow runs when code is pushed to the main branch + - main # This workflow runs when code is pushed to the main branch ok jobs: test: From a20bcbe98af5f1487791de1c7bfbf3e058c125cf Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:23:51 -0500 Subject: [PATCH 32/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 82 ++++---------------------------------- 1 file changed, 7 insertions(+), 75 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 823ad88a..d8c5f3e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,85 +1,17 @@ -# .github/workflows/deploy-website.yml - Streamlined for core functionality (with path debug) -name: Deploy website +# .github/workflows/main.yml - Barebones workflow for testing parsing +name: Basic Workflow Test on: push: branches: - - main # This workflow runs when code is pushed to the main branch ok + - main jobs: - test: + run-simple-command: runs-on: ubuntu-latest - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Checks out your repository's code - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - run: npm ci - - - name: Lint code - run: npm run lint - - - name: Test code - run: npm run test - - build: - needs: test - runs-on: ubuntu-latest - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' - steps: - - name: Get code - uses: actions/checkout@v3 - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - run: npm ci - - - name: Build website - run: npm run build - - # --- NEW DEBUG STEP TO GET PATH --- - - name: Debug: Check 'dist' folder contents - run: | - echo "Current working directory (where 'dist' is expected to be):" - pwd - echo "" - echo "Contents of 'dist' folder:" - ls -F dist/ || echo "Error: 'dist' folder not found or is empty here!" - # --- END NEW DEBUG STEP --- - - - name: Upload artifacts - uses: actions/upload-artifact@v4 # Updated to v4 - with: - name: dist-files - path: dist # Path to the built files (relative to the working directory) - if-no-files-found: warn - compression-level: 6 - overwrite: false - include-hidden-files: false - - deploy: - needs: build - runs-on: ubuntu-latest - steps: - - name: Get build artifacts - uses: actions/download-artifact@v4 # Updated to v4 - with: - name: dist-files - - name: Deploy - run: echo "Deployment placeholder executed." \ No newline at end of file + - name: Run a simple command + run: echo "Hello, GitHub Actions! This workflow ran successfully." \ No newline at end of file From d4d23df4def7477dd2fccac3bab3530b20549119 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:25:15 -0500 Subject: [PATCH 33/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8c5f3e1..0e83e116 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,17 +1,34 @@ -# .github/workflows/main.yml - Barebones workflow for testing parsing -name: Basic Workflow Test +# .github/workflows/main.yml - Workflow with testing job +name: Workflow with Tests on: push: branches: - - main + - main # This workflow runs when code is pushed to the main branch jobs: - run-simple-command: + test: runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this 'test' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory steps: - name: Get code uses: actions/checkout@v3 # Checks out your repository's code - - name: Run a simple command - run: echo "Hello, GitHub Actions! This workflow ran successfully." \ No newline at end of file + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm # Path to the directory to cache + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + + - name: Install dependencies + run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + + - name: Lint code + run: npm run lint # Runs your project's lint script + + - name: Test code + run: npm run test # Runs your project's test script \ No newline at end of file From 87ed2b1e2a3bcf07a6aefe733a0eb0ca867f435b Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:28:04 -0500 Subject: [PATCH 34/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e83e116..d1cd4912 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ -# .github/workflows/main.yml - Workflow with testing job -name: Workflow with Tests +# .github/workflows/main.yml - Workflow with Build and Test jobs +name: Build and Test Workflow on: push: @@ -7,10 +7,42 @@ on: - main # This workflow runs when code is pushed to the main branch jobs: + build: + runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands and actions + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm # Path to the directory to cache + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + + - name: Install dependencies + run: npm ci # Installs dependencies from package-lock.json + + - name: Build website + run: npm run build # Builds your website for production + + - name: Upload artifacts + uses: actions/upload-artifact@v4 # Using version 4 as required + with: + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) + if-no-files-found: warn # Warn if no files found, but don't fail job + compression-level: 6 + overwrite: false + include-hidden-files: false + test: + needs: build # This job will only run after the 'build' job completes successfully runs-on: ubuntu-latest # Define the default working directory for all 'run' commands in this 'test' job. - # This assumes your package.json, package-lock.json, etc., are inside this directory. defaults: run: working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory From f869db55f3a2fcfe88ba5f45608dbe9fa2df8457 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:30:43 -0500 Subject: [PATCH 35/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1cd4912..32fbe19a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/main.yml - Workflow with Build and Test jobs +# .github/workflows/main.yml - Workflow with Build and Test jobs (and Debugging for dist) name: Build and Test Workflow on: @@ -9,7 +9,6 @@ on: jobs: build: runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands and actions defaults: run: working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory @@ -29,6 +28,22 @@ jobs: - name: Build website run: npm run build # Builds your website for production + # --- CRITICAL DEBUG STEP - DO NOT REMOVE THIS --- + - name: Debug: Check 'dist' folder contents + run: | + echo "--- Current Working Directory for this job step ---" + pwd + echo "" + echo "--- Contents of Current Working Directory ---" + ls -F + echo "" + echo "--- Contents of 'dist' folder (if found) ---" + ls -F dist/ || echo "Error: 'dist' folder not found or is empty at this location!" + echo "" + echo "--- Recursive listing from Current Working Directory ---" + ls -R + # --- END CRITICAL DEBUG STEP --- + - name: Upload artifacts uses: actions/upload-artifact@v4 # Using version 4 as required with: @@ -42,7 +57,6 @@ jobs: test: needs: build # This job will only run after the 'build' job completes successfully runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands in this 'test' job. defaults: run: working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory From 4e2991f8302a09fd3f8ae0ef60f2009eba46d903 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:31:59 -0500 Subject: [PATCH 36/45] Final attempt: Clean paste with whitespace verification --- .github/workflows/main.yml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 32fbe19a..d1cd4912 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/main.yml - Workflow with Build and Test jobs (and Debugging for dist) +# .github/workflows/main.yml - Workflow with Build and Test jobs name: Build and Test Workflow on: @@ -9,6 +9,7 @@ on: jobs: build: runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands and actions defaults: run: working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory @@ -28,22 +29,6 @@ jobs: - name: Build website run: npm run build # Builds your website for production - # --- CRITICAL DEBUG STEP - DO NOT REMOVE THIS --- - - name: Debug: Check 'dist' folder contents - run: | - echo "--- Current Working Directory for this job step ---" - pwd - echo "" - echo "--- Contents of Current Working Directory ---" - ls -F - echo "" - echo "--- Contents of 'dist' folder (if found) ---" - ls -F dist/ || echo "Error: 'dist' folder not found or is empty at this location!" - echo "" - echo "--- Recursive listing from Current Working Directory ---" - ls -R - # --- END CRITICAL DEBUG STEP --- - - name: Upload artifacts uses: actions/upload-artifact@v4 # Using version 4 as required with: @@ -57,6 +42,7 @@ jobs: test: needs: build # This job will only run after the 'build' job completes successfully runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this 'test' job. defaults: run: working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory From 5f4055ec218143bec7b74526af23d06cb6e000d6 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:35:40 -0500 Subject: [PATCH 37/45] debugging --- .github/workflows/main.yml | 55 +++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1cd4912..dcdad2ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# .github/workflows/main.yml - Workflow with Build and Test jobs +# .github/workflows/main.yml - Workflow with Build and Test jobs (and Debugging for dist) name: Build and Test Workflow on: @@ -9,7 +9,6 @@ on: jobs: build: runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands and actions defaults: run: working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory @@ -20,47 +19,65 @@ jobs: - name: Cache dependencies uses: actions/cache@v3 with: - path: ~/.npm # Path to the directory to cache - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci # Installs dependencies from package-lock.json + run: npm ci - name: Build website - run: npm run build # Builds your website for production + run: npm run build + + # --- CRITICAL DEBUG STEP - DO NOT REMOVE THIS --- + - name: Debug: Check 'dist' folder contents and path + run: | + echo "--- Current Working Directory for this job step ---" + pwd + echo "" + echo "--- Contents of Current Working Directory ---" + ls -F + echo "" + echo "--- Contents of 'dist' folder (if found) ---" + ls -F dist/ || echo "Error: 'dist' folder not found or is empty at this location!" + echo "" + echo "--- Absolute path to 'dist' folder (if exists) ---" + if [ -d "dist" ]; then realpath dist; else echo "'dist' folder does not exist."; fi + echo "" + echo "--- Recursive listing from Current Working Directory ---" + ls -R + # --- END CRITICAL DEBUG STEP --- - name: Upload artifacts - uses: actions/upload-artifact@v4 # Using version 4 as required + uses: actions/upload-artifact@v4 with: - name: dist-files # Name for the uploaded artifact - path: dist # Path to the built files (relative to the working directory) - if-no-files-found: warn # Warn if no files found, but don't fail job + name: dist-files + path: dist + if-no-files-found: warn compression-level: 6 overwrite: false include-hidden-files: false test: - needs: build # This job will only run after the 'build' job completes successfully + needs: build runs-on: ubuntu-latest - # Define the default working directory for all 'run' commands in this 'test' job. defaults: run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code + uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v3 with: - path: ~/.npm # Path to the directory to cache - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + run: npm ci - name: Lint code - run: npm run lint # Runs your project's lint script + run: npm run lint - name: Test code - run: npm run test # Runs your project's test script \ No newline at end of file + run: npm run test From ee48bcd76ed2ce1b019c952f4c4c4ce881a5e0fe Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:37:14 -0500 Subject: [PATCH 38/45] debugging --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dcdad2ee..b60594d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,19 @@ -# .github/workflows/main.yml - Workflow with Build and Test jobs (and Debugging for dist) name: Build and Test Workflow on: push: branches: - - main # This workflow runs when code is pushed to the main branch + - main jobs: build: runs-on: ubuntu-latest defaults: run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code - uses: actions/checkout@v3 # Checks out your repository's code + uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v3 From 68046330eba6be78da97b478390cf84133aedf84 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:38:22 -0500 Subject: [PATCH 39/45] debugging --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b60594d7..7e99667f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + key: deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }} - name: Install dependencies run: npm ci @@ -70,13 +70,12 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + key: deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }} - name: Install dependencies run: npm ci - name: Lint code run: npm run lint - - name: Test code run: npm run test From a51e460f3d394c29296ba586e9dc03e4eef0b708 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:41:00 -0500 Subject: [PATCH 40/45] debugging --- .github/workflows/main.yml | 39 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e99667f..2a8c9cba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,13 +8,14 @@ on: jobs: build: runs-on: ubuntu-latest - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code uses: actions/checkout@v3 + - name: Set working directory + run: echo "Setting working directory" + working-directory: ./Code/04\ Artifacts\ \&\ Outputs/03\ Finished\ Project + - name: Cache dependencies uses: actions/cache@v3 with: @@ -23,34 +24,27 @@ jobs: - name: Install dependencies run: npm ci + working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project - name: Build website run: npm run build + working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project - # --- CRITICAL DEBUG STEP - DO NOT REMOVE THIS --- - name: Debug: Check 'dist' folder contents and path run: | - echo "--- Current Working Directory for this job step ---" + echo "--- Current Working Directory ---" pwd - echo "" - echo "--- Contents of Current Working Directory ---" - ls -F - echo "" - echo "--- Contents of 'dist' folder (if found) ---" - ls -F dist/ || echo "Error: 'dist' folder not found or is empty at this location!" - echo "" - echo "--- Absolute path to 'dist' folder (if exists) ---" - if [ -d "dist" ]; then realpath dist; else echo "'dist' folder does not exist."; fi - echo "" - echo "--- Recursive listing from Current Working Directory ---" - ls -R - # --- END CRITICAL DEBUG STEP --- + echo "--- Contents of 'dist' folder ---" + ls -F dist/ || echo "dist folder not found" + echo "--- Absolute path to 'dist' ---" + if [ -d "dist" ]; then realpath dist; else echo "dist does not exist"; fi + working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: dist-files - path: dist + path: ./Code/04 Artifacts & Outputs/03 Finished Project/dist if-no-files-found: warn compression-level: 6 overwrite: false @@ -59,9 +53,6 @@ jobs: test: needs: build runs-on: ubuntu-latest - defaults: - run: - working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' steps: - name: Get code uses: actions/checkout@v3 @@ -74,8 +65,12 @@ jobs: - name: Install dependencies run: npm ci + working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project - name: Lint code run: npm run lint + working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + - name: Test code run: npm run test + working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project From 08e9a5f309bc1bb6702456c2d6cf220b63c10357 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:42:32 -0500 Subject: [PATCH 41/45] debugging --- .github/workflows/main.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a8c9cba..daad4f75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,10 +12,6 @@ jobs: - name: Get code uses: actions/checkout@v3 - - name: Set working directory - run: echo "Setting working directory" - working-directory: ./Code/04\ Artifacts\ \&\ Outputs/03\ Finished\ Project - - name: Cache dependencies uses: actions/cache@v3 with: @@ -24,11 +20,11 @@ jobs: - name: Install dependencies run: npm ci - working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + working-directory: Code/04 Artifacts & Outputs/03 Finished Project - name: Build website run: npm run build - working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + working-directory: Code/04 Artifacts & Outputs/03 Finished Project - name: Debug: Check 'dist' folder contents and path run: | @@ -38,13 +34,15 @@ jobs: ls -F dist/ || echo "dist folder not found" echo "--- Absolute path to 'dist' ---" if [ -d "dist" ]; then realpath dist; else echo "dist does not exist"; fi - working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + echo "--- Recursive listing ---" + ls -R + working-directory: Code/04 Artifacts & Outputs/03 Finished Project - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: dist-files - path: ./Code/04 Artifacts & Outputs/03 Finished Project/dist + path: Code/04 Artifacts & Outputs/03 Finished Project/dist if-no-files-found: warn compression-level: 6 overwrite: false @@ -65,12 +63,12 @@ jobs: - name: Install dependencies run: npm ci - working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + working-directory: Code/04 Artifacts & Outputs/03 Finished Project - name: Lint code run: npm run lint - working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + working-directory: Code/04 Artifacts & Outputs/03 Finished Project - name: Test code run: npm run test - working-directory: ./Code/04 Artifacts & Outputs/03 Finished Project + working-directory: Code/04 Artifacts & Outputs/03 Finished Project From c746b0cca89be7fdd47745fab49abc7710055783 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:44:05 -0500 Subject: [PATCH 42/45] debugging --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daad4f75..0c7f6adf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }} + key: "deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }}" - name: Install dependencies run: npm ci @@ -59,7 +59,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }} + key: "deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }}" - name: Install dependencies run: npm ci From 9a4f50b421c2c9676993ca9d204218c77ebc9ebe Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:45:13 -0500 Subject: [PATCH 43/45] debugging --- .github/workflows/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c7f6adf..a716ad6e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,15 +16,15 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: "deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }}" + key: "deps-node-modules-${{ hashFiles('\"Code/04 Artifacts & Outputs/03 Finished Project\"/package-lock.json') }}" - name: Install dependencies run: npm ci - working-directory: Code/04 Artifacts & Outputs/03 Finished Project + working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" - name: Build website run: npm run build - working-directory: Code/04 Artifacts & Outputs/03 Finished Project + working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" - name: Debug: Check 'dist' folder contents and path run: | @@ -36,13 +36,13 @@ jobs: if [ -d "dist" ]; then realpath dist; else echo "dist does not exist"; fi echo "--- Recursive listing ---" ls -R - working-directory: Code/04 Artifacts & Outputs/03 Finished Project + working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: dist-files - path: Code/04 Artifacts & Outputs/03 Finished Project/dist + path: "Code/04 Artifacts & Outputs/03 Finished Project/dist" if-no-files-found: warn compression-level: 6 overwrite: false @@ -59,16 +59,16 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: "deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }}" + key: "deps-node-modules-${{ hashFiles('\"Code/04 Artifacts & Outputs/03 Finished Project\"/package-lock.json') }}" - name: Install dependencies run: npm ci - working-directory: Code/04 Artifacts & Outputs/03 Finished Project + working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" - name: Lint code run: npm run lint - working-directory: Code/04 Artifacts & Outputs/03 Finished Project + working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" - name: Test code run: npm run test - working-directory: Code/04 Artifacts & Outputs/03 Finished Project + working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" From 2dcaca4bb13f6f0ccde85dff8cf78740a23f442f Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 10:46:48 -0500 Subject: [PATCH 44/45] debugging --- .github/workflows/main.yml | 62 +++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a716ad6e..d6b1a3fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,74 +1,68 @@ +# .github/workflows/main.yml - Build and Test Workflow (Cleaned) name: Build and Test Workflow on: push: branches: - - main + - main # This workflow runs when code is pushed to the main branch jobs: build: runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands and actions in this job + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory steps: - name: Get code - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Checks out your repository's code - name: Cache dependencies uses: actions/cache@v3 with: - path: ~/.npm - key: "deps-node-modules-${{ hashFiles('\"Code/04 Artifacts & Outputs/03 Finished Project\"/package-lock.json') }}" + path: ~/.npm # Path to the directory to cache + # Corrected hashFiles key syntax + key: "deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }}" - name: Install dependencies - run: npm ci - working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" + run: npm ci # Installs dependencies from package-lock.json - name: Build website - run: npm run build - working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" - - - name: Debug: Check 'dist' folder contents and path - run: | - echo "--- Current Working Directory ---" - pwd - echo "--- Contents of 'dist' folder ---" - ls -F dist/ || echo "dist folder not found" - echo "--- Absolute path to 'dist' ---" - if [ -d "dist" ]; then realpath dist; else echo "dist does not exist"; fi - echo "--- Recursive listing ---" - ls -R - working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" + run: npm run build # Builds your website for production - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4 # Using version 4 with: - name: dist-files - path: "Code/04 Artifacts & Outputs/03 Finished Project/dist" - if-no-files-found: warn + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) + if-no-files-found: warn # Warn if no files found, but don't fail job compression-level: 6 overwrite: false include-hidden-files: false test: - needs: build + needs: build # This job will only run after the 'build' job completes successfully runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this job. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # Your specified subdirectory steps: - name: Get code - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Checks out your repository's code - name: Cache dependencies uses: actions/cache@v3 with: - path: ~/.npm - key: "deps-node-modules-${{ hashFiles('\"Code/04 Artifacts & Outputs/03 Finished Project\"/package-lock.json') }}" + path: ~/.npm # Path to the directory to cache + # Corrected hashFiles key syntax + key: "deps-node-modules-${{ hashFiles('Code/04 Artifacts & Outputs/03 Finished Project/package-lock.json') }}" - name: Install dependencies - run: npm ci - working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" + run: npm ci # Installs dependencies from package-lock.json - name: Lint code - run: npm run lint - working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" + run: npm run lint # Runs your project's lint script - name: Test code - run: npm run test - working-directory: "Code/04 Artifacts & Outputs/03 Finished Project" + run: npm run test # Runs your project's test script \ No newline at end of file From f14f82b275af294f14d7ebe693fc8e998cac17d7 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Sat, 7 Jun 2025 11:09:08 -0500 Subject: [PATCH 45/45] files --- .../.github/workflows/main.yml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/main.yml diff --git a/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/main.yml b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/main.yml new file mode 100644 index 00000000..6ed450e5 --- /dev/null +++ b/Code/04 Artifacts & Outputs/03 Finished Project/.github/workflows/main.yml @@ -0,0 +1,89 @@ +# .github/workflows/deploy-website.yml +name: Deploy website + +on: + push: + branches: + - main # This workflow runs when code is pushed to the main branch + +jobs: + test: + runs-on: ubuntu-latest + # Define the default working directory for all 'run' commands in this 'test' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm # Path to the directory to cache + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} # Cache key based on package-lock.json + + - name: Install dependencies + run: npm ci # Installs dependencies from package-lock.json (requires it to be present) + + - name: Lint code + run: npm run lint # Runs your project's lint script + + - name: Test code + run: npm run test # Runs your project's test script + + build: + needs: test # This job will only run after the 'test' job completes successfully + runs-on: ubuntu-latest + outputs: + script-file: ${{ steps.publish.outputs.script-file }} # Outputs the generated JavaScript filename + # Define the default working directory for all 'run' commands in this 'build' job. + # This assumes your package.json, package-lock.json, etc., are inside this directory. + defaults: + run: + working-directory: './Code/04 Artifacts & Outputs/03 Finished Project' # <--- Correct path for your project + steps: + - name: Get code + uses: actions/checkout@v3 # Checks out your repository's code + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: deps-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + run: npm ci # Installs dependencies + + - name: Build website + run: npm run build # Builds your website for production + # Note: The 'dist/' path here is relative to the working-directory set above. + # So, if your project builds to 'Code/04 Artifacts & Outputs/03 Finished Project/dist', + # then 'dist/' is correct. + + - name: Publish JS filename + id: publish # Gives this step an ID to reference its outputs + # Finds the generated JS file in 'dist/assets' and sets it as an output + run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';' + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: dist-files # Name for the uploaded artifact + path: dist # Path to the built files (relative to the working directory) + + deploy: + needs: build # This job will only run after the 'build' job completes successfully + runs-on: ubuntu-latest + steps: + - name: Get build artifacts + uses: actions/download-artifact@v3 # Downloads the 'dist-files' artifact + with: + name: dist-files # Name of the artifact to download + - name: Output contents + run: ls # Lists the contents of the current directory (should show 'dist' files) + - name: Output filename + run: echo "Generated script file: ${{ needs.build.outputs.script-file }}" # Displays the JS filename from the build job + - name: Deploy + run: echo "Deployment placeholder executed." \ No newline at end of file