Update and deploy #524
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: Update and deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths-ignore: | |
- README.md | |
schedule: | |
- cron: "00 1 * * *" | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
deploy: | |
environment: azure | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: "Az login" | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
allow-no-subscriptions: true | |
enable-AzPSSession: true | |
- name: "Get all Policy Aliases" | |
uses: azure/powershell@v1 | |
with: | |
inlineScript: | | |
./src/ps1/Get-AzResourcePolicyAliases.ps1 | |
azPSVersion: "latest" | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: "0.113.0" | |
extended: true | |
- name: Build Hugo site | |
run: hugo | |
- name: "List generated contents" | |
run: | | |
ls content | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
cname: policyalias.mats.codes | |
commit_message: "docs: update and publish (${{ github.event_name }})" |