-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (99 loc) · 3.26 KB
/
deploy.yml
File metadata and controls
112 lines (99 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# ==============================================================================
# File: deploy.yml
# Author: Amey Thakur
# Profile: https://github.com/Amey-Thakur
# Repository: https://github.com/Amey-Thakur/Amey-Thakur.github.io
# Release Date: December 16, 2025
# License: MIT License
# ==============================================================================
#
# DESCRIPTION:
# This workflow automates the continuous integration and deployment (CI/CD)
# pipeline for Amey's Arc. It orchestrates the Hugo build process, asset
# minification, and secure delivery to GitHub Pages.
#
# HOW IT WORKS:
# Upon a push to the main branch, the workflow initializes a virtual Linux
# environment, retrieves the repository and its theme submodules, and
# executes the Hugo generator from the project's source directory. The
# resulting static artifacts are then verified and deployed to the GitHub
# Pages edge network.
#
# TECH STACK:
# - GitHub Actions (CI/CD)
# - Hugo (Static Site Generation)
# - Shell/Bash (Build Scripting)
#
# ==============================================================================
name: Deploy
on:
push:
paths-ignore:
- "images/**"
- "LICENSE"
- "README.md"
branches:
- main
workflow_dispatch:
# Facilitates manual trigger for specific version testing or maintenance.
inputs:
hugoVersion:
description: "Hugo Engine Version Override"
required: false
default: "0.152.2"
# Prevents racing conditions by ensuring only one deployment occurs at a time.
concurrency:
group: "pages"
cancel-in-progress: true
defaults:
run:
shell: bash
# Granular permission mapping for secure repository access and deployment.
permissions:
contents: read
pages: write
id-token: write
jobs:
# Construction Phase: Building the static site artifacts
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.152.2' }}
steps:
- name: Provision Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Source Synchronization
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Initialize Web Hosting Interface
id: pages
uses: actions/configure-pages@v5
- name: Resolve Theme Dependencies
run: git submodule update --init --recursive
- name: Synchronize Submodule Integrity
run: git submodule update --remote --merge
- name: Execute Hugo Build
working-directory: "Source Code"
run: |
hugo --config Site.toml \
--minify \
--baseURL ${{ steps.pages.outputs.base_url }}
- name: Preserve Build Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# Distribution Phase: Delivery to the production environment
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Initiate Production Deployment
id: deployment
uses: actions/deploy-pages@v4