.github/workflows/scan.yaml #855
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
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
schedule: | |
- cron: '30 9,15,21,3 * * *' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
permissions: | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Homebrew/actions/setup-homebrew@master | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Install tools | |
run: brew install trivy grype ocicl sqlite && ocicl setup > ~/.sbclrc && ocicl install | |
shell: bash | |
- name: Generate scan results | |
run: | | |
echo ${{ github.token }} | oras login ghcr.io -u ${{ github.actor }} --password-stdin | |
mkdir ./_site | |
echo ${{ secrets.REDHAT_PASSWORD }} | docker login -u="${{ secrets.REDHAT_USERNAME }}" --password-stdin registry.redhat.io | |
echo ${{ secrets.REDHAT_PASSWORD }} | podman login -u="${{ secrets.REDHAT_USERNAME }}" --password-stdin registry.redhat.io | |
./run.sh | |
cp index.html ./_site | |
shell: bash | |
- name: Upload artifact | |
# Automatically uploads an artifact from the './_site' directory by default | |
uses: actions/upload-pages-artifact@v3 | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |