mirror of
https://github.com/dbt-labs/dbt-project-evaluator.git
synced 2025-12-18 02:11:27 +00:00
Updated action references from tags/branches to specific commit SHAs for improved security and reproducibility.
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: Publish MkDocs on Release
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # actions/setup-python@v4
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install mkdocs-material mike
|
|
|
|
- name: Extract Major and Minor Version
|
|
run: |
|
|
VERSION_TAG=${{ github.event.release.tag_name }}
|
|
VERSION_TAG="${VERSION_TAG#v}" # Remove 'v' prefix if present
|
|
MAJOR="${VERSION_TAG%%.*}"
|
|
MINOR="${VERSION_TAG#*.}"
|
|
MINOR="${MINOR%%.*}"
|
|
MAJOR_MINOR_VERSION="${MAJOR}.${MINOR}"
|
|
echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV
|
|
|
|
- name: Deploy Updated Docs
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
git config user.name "GitHub Actions"
|
|
git config user.email "actions@github.com"
|
|
mike deploy --push --message "Deploy docs for release ${{ github.event.release.tag_name }}" --update-alias $MAJOR_MINOR_VERSION latest
|
|
mike set-default --push latest
|