Merge pull request #60 from nkdAgility/update/20231023 #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docs | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Build job | |
build: | |
outputs: | |
version: ${{ steps.gitversion.outputs.semVer }} | |
environment: | |
name: nakedalmweb-githubSDK | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: '5.x' | |
- name: Display GitVersion config | |
id: gitversion # id to later be referenced | |
uses: gittools/actions/gitversion/execute@v0 | |
- uses: cschleiden/replace-tokens@v1 | |
with: | |
files: '["**/*.html"]' | |
tokenPrefix: "${" | |
tokenSuffix: "}" | |
- uses: igsekor/pyspelling-any@v1.0.4 | |
id: spellcheck | |
name: Spellcheck | |
- name: Build Jekyll | |
uses: jerryjvl/jekyll-build-action@v1 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: _site | |
path: ./_site/**/* | |
publish: | |
environment: | |
name: nakedalmweb-githubSDK | |
needs: [build] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download a single artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: _site | |
path: ./_site | |
- name: SFTP Upload | |
# You may pin to the exact commit or the version. | |
# uses: Dylan700/sftp-upload-action@f90db607d9fe1acdc0eefccee84d37c119b268fe | |
uses: Dylan700/sftp-upload-action@v1.1.4 | |
with: | |
server: nakedalmweb.sftp.wpengine.com | |
username: nakedalmweb-learn | |
password: ${{ secrets.SFTP_PASSWORD }} | |
port: 2222 | |
# If true, outputs the results of the upload, without actually uploading. | |
dry-run: false | |
# A list of folders to upload in the format of `folder/ => upload_folder/` | |
uploads: | | |
./_site/ => ./agile-delivery-kit | |
# If true, any existing files in the remote upload directories are deleted. | |
delete: true | |
release: | |
environment: | |
name: nakedalmweb-githubSDK | |
needs: [publish, build] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Tag with v${{needs.build.outputs.version}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
run: | | |
git tag v${{needs.build.outputs.version}} | |
git push origin --tags | |
gh release create v${{needs.build.outputs.version}} --generate-notes --latest |