Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflow documentation make_site.yaml
Browse files Browse the repository at this point in the history
Darkeye14 committed Dec 4, 2024
1 parent dd6fc95 commit 9ec785e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/make_site.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
#This workflow is designed to automate the process of building and deploying a Kotlin/JS web application to GitHub Pages.
#It ensures that whenever changes are merged into the dev branch or when manually triggered, the web application is built,
#packaged, and deployed to the GitHub Pages environment, making it accessible online.

# Workflow to build and deploy the web application to GitHub Pages
name: Publish Web App

# Trigger conditions for the workflow
on:
# Trigger on pull request close events to the dev branch
# Automatically triggers the workflow when a pull request is closed and merged into the dev branch.
pull_request:
branches: [ "dev" ]
types: [ closed ]
# Manual trigger option from GitHub Actions UI
# Allows Manual trigger option from GitHub Actions UI
workflow_dispatch:

# Concurrency settings to manage multiple workflow runs
# This ensures orderly deployment to production environment
concurrency:
#Groups workflow runs related to GitHub Pages deployment.
group: "pages"
# Don't cancel running deployments to ensure production stability
# Prevents cancellation of in-progress deployments to ensure stability, especially in production environments.
cancel-in-progress: false

jobs:
# Main job to build and deploy the web application
build_web_app:
# Configure deployment environment and URL
#Specifies the deployment environment as github-pages and sets the URL using the output from the deployment step.
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Use Windows runner for build environment
runs-on: windows-latest
# Required permissions for GitHub Pages deployment
# Grants necessary permissions for reading repository contents, writing to GitHub Pages, and writing authentication tokens.
permissions:
contents: read # Read repository contents
pages: write # Write to GitHub Pages
id-token: write # Write authentication tokens

steps:
# Step 1: Check out the repository code
# Step 1: Check out the repository code to the runner
- uses: actions/checkout@v4

# Step 2: Set up Java development environment
@@ -42,22 +49,22 @@ jobs:
distribution: 'zulu' # Use Zulu distribution of OpenJDK
java-version: 17 # Use Java 17 version

# Step 3: Build the Kotlin/JS web application
# Step 3:Executes the Gradle task jsBrowserDistribution to Build the Kotlin/JS web application
- name: Build Web(JS) App
run: ./gradlew jsBrowserDistribution

# Step 4: Configure GitHub Pages settings
- name: Setup Pages
uses: actions/configure-pages@v5

# Step 5: Upload the built web application as an artifact
# Step 5: Upload the built web application as an artifact to GitHub pages
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
# Path to the built web application files
path: './mifospay-web/build/dist/js/productionExecutable/'

# Step 6: Deploy the artifact to GitHub Pages
# Step 6: Deploy the artifact to GitHub Pages, making the web application live.
- name: Deploy to GitHub Pages
id: deployment # ID used for environment URL output
uses: actions/deploy-pages@v4

0 comments on commit 9ec785e

Please sign in to comment.