toevoegen maatregelen veiligheid #2767
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: Deploy PR preview | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
concurrency: preview-${{ github.ref }} | |
jobs: | |
deploy: | |
name: deploy PR | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: get tag | |
id: get_commit_hash | |
run: | | |
echo "commit_hash=$(git describe --tags)" >> "$GITHUB_OUTPUT" | |
- name: inject version | |
run: | | |
sed -i 's/development/${{ steps.get_commit_hash.outputs.commit_hash }}/g' docs/version.md | |
- name: Add url | |
run: | | |
echo "site_url: https://minbzk.github.io/Algoritmekader/pr-preview/pr-${{github.event.number}}" >> mkdocs.yml | |
- uses: actions/setup-python@v5 | |
if: github.event.action != 'closed' | |
with: | |
python-version: 3.x | |
cache: 'pip' | |
- name: install dependencies | |
if: github.event.action != 'closed' | |
run: | | |
git config --global url."https://github-actions:${{ secrets.MATERIAL_INSIDERS_TOKEN }}@github".insteadOf ssh://git@github | |
pip install -r requirements.txt | |
- name: build preview | |
if: github.event.action != 'closed' | |
run: mkdocs build | |
- uses: actions/upload-artifact@v4 | |
if: github.event.action != 'closed' | |
with: | |
name: AlgoritmeKaderWebsite-${{github.event.number}} | |
path: ./site/ | |
- name: Deploy preview | |
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' | |
uses: rossjrw/pr-preview-action@v1 | |
with: | |
source-dir: ./site/ |