Skip to content

Commit

Permalink
🔧 (CI/CD): add GitHub Actions workflows for build, release, and PR cl…
Browse files Browse the repository at this point in the history
…eanup

Add new GitHub Actions workflows to automate the build, release, and
cleanup processes. The `.spellcheck.yml` configuration is updated to
include HTML files for spell checking, ensuring consistency across
documentation. The `GitVersion.yml` file is introduced to manage
versioning, supporting continuous delivery with semantic versioning.
The `close-pr.yaml` workflow automates the cleanup of environments
after pull requests are closed, improving resource management. The
`main.yaml` workflow handles the build and release process, including
versioning, artifact management, and deployment to Azure Static Web
Apps. These changes enhance the CI/CD pipeline, ensuring efficient
and consistent deployment processes.
  • Loading branch information
MrHinsh committed Nov 14, 2024
1 parent 12d9739 commit a7b673c
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/.spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ matrix:
sources:
- "**/*.md"
- "*.md"
- "**/*.html"
- "*.html"
default_encoding: utf-8
aspell:
lang: en
Expand Down
27 changes: 27 additions & 0 deletions .github/GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
continuous-delivery-fallback-tag: 'Canary'
next-version: 0.0.1
branches:
main:
mode: ContinuousDelivery
tag: 'Preview'
increment: Patch
is-mainline: true
prevent-increment-of-merged-branch-version: false
tracks-release-branches: true
regex: ^master$|^main$
release:
mode: ContinuousDelivery
tag: ""
increment: Patch
track-merge-target: false
regex: ^release(s)?[\/-]
source-branches:
- master
- main
is-release-branch: true
is-mainline: false
ignore:
sha: []
merge-message-formats: {}
25 changes: 25 additions & 0 deletions .github/workflows/close-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Azure Static Web App PR Cleanup

on:
pull_request:
types: [closed]

jobs:
pr_cleanup:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
- name: Clean up pull request environment
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: "close"
deployment_environment: canary-${{ github.event.pull_request.number }}
app_location: ""
skip_app_build: true
skip_api_build: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit a7b673c

Please sign in to comment.