Skip to content

check-ssl-expiry

check-ssl-expiry #42

# This is a basic workflow to help you get started with Actions
name: check-ssl-expiry
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 01:00 UTC makes 12pm AEDT on Weekdays Mon,Tue,Wed,Thu,Fri
schedule:
- cron: 0 1 * * 1,2,3,4,5
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
check_ssl_expiry:
name: 'Check SSL Expiry'
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a set of commands using the runners shell
- name: Check SSL Expiry
shell: pwsh
run: |
./check-ssl-expiry.ps1
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3.1.1
with:
# Artifact name
name: SSL Expiry Custom HTML Report
# A file, directory or wildcard pattern that describes what to upload
path: ./_site
# The desired behavior if no files are found using the provided path.
if-no-files-found: warn # optional, default is warn
retention-days: 90
- name: Run Pester Tests
shell: pwsh
run: |
# This updates pester not always necessary but worth noting
Install-Module -Name Pester -Force -SkipPublisherCheck
Import-Module Pester
Invoke-Pester -Script ./tests/Run-Tests.ps1 `
-OutputFile ./TestResults.xml `
-OutputFormat JUnitXml
deploy:
if: ${{ always() }}
name: Deploy to GitHub Pages
needs: check_ssl_expiry
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download a Build Artifact
uses: actions/download-artifact@v3.0.1
with:
# Artifact name
name: SSL Expiry Custom HTML Report
# Destination path
path: .
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1