Pull request workflow
Changes land through reviewed pull requests, and the default branch stays releasable.
Continuous delivery sample
A small static site, shipped the way production software should be: built, tested and deployed automatically on every change.
Every merge to master moves through the same four stages.
Gradle validates the project and packages the site as a build artifact.
Static checks confirm the required files exist and the markup is valid.
The artifact is published to a staging host for a final manual review.
After approval the same artifact is promoted to production over SSH.
Two pipelines share one repository: GitHub Actions validates every pull request and publishes this site, while Jenkins promotes the packaged artifact to staging and production.
master publish the site and start the Jenkins release.The configuration that drives the pipeline, trimmed to the essentials.
tasks.register('verifySite') {
doLast {
def missing = requiredFiles.findAll {
!siteDir.file(it).asFile.exists()
}
if (missing) {
throw new GradleException(
"Missing site files: ${missing.join(', ')}")
}
}
}
tasks.register('siteZip', Zip) {
from siteDir
destinationDirectory =
layout.buildDirectory.dir('distributions')
}
stage('Deploy to production') {
when { branch 'master' }
steps {
input message: 'Does the staging environment look OK?'
milestone(1)
deployTo('production')
}
}
- uses: gradle/actions/setup-gradle@v4
- name: Build and verify
run: ./gradlew build --no-daemon
- name: Validate HTML
run: npx --yes html-validate@8 src/index.html
$ ./gradlew build
> Task :verifySite
> Task :siteZip
> Task :assemble
> Task :check
> Task :build
BUILD SUCCESSFUL
Changes land through reviewed pull requests, and the default branch stays releasable.
One artifact is promoted through each environment, so what was tested is what ships.
Production releases wait for an explicit sign-off after staging is verified.
Credentials live in the CI credential store and are never committed to the repository.
| Area | Tool | Role |
|---|---|---|
| Build | Gradle 8.10.2 | Verifies the site and packages it as a zip |
| Runtime | JDK 17 (Temurin) | Runs Gradle locally and in CI |
| CI | GitHub Actions | Build, HTML validation, Pages deploy |
| Release | Jenkins | Staging, approval gate, production |
| Transport | Publish over SSH | Copies the site to each environment |
| Frontend | HTML, CSS, vanilla JS | No framework or build step required |