Skip to content

Fix header image

Fix header image #127

Workflow file for this run

name: Linter, test, build and push KPA container
env:
KPA_PROJECT: example
REGISTRY_GHCR: ghcr.io/mmul-it
REGISTRY_QUAY: quay.io/mmul
CONTAINER_NAME: kpa
on: [push,workflow_dispatch]
jobs:
linter:
runs-on: ubuntu-latest
container:
image: ghcr.io/mmul-it/kpa-marp-pandoc:v1.0.0
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Ansible requirements
run: ansible-galaxy install
-r playbooks/roles/requirements.yml
--roles-path ./playbooks/roles
- name: Check Ansible Playbook Linter
run: ansible-lint playbooks/*.yml
- name: Check project yamls
run: yamllint -s projects/${KPA_PROJECT}/*.yml
- name: Check markdown files for example project
run: mdl projects/${KPA_PROJECT}/contents/*.md
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/mmul-it/kpa-marp-pandoc:v1.0.0
needs: linter
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Ansible requirements
run: ansible-galaxy install
-r playbooks/roles/requirements.yml
--roles-path ./playbooks/roles
- name: Generate markdown and pdf files
run: for KPA_DOC in $(ls projects/${KPA_PROJECT}/*.yml); do
ansible-playbook
-e @projects/${KPA_PROJECT}/common/settings.yml
-e @${KPA_DOC}
playbooks/kpa_generator.yml;
done
- name: Upload generated markdown files
uses: actions/upload-artifact@v3
with:
name: markdowns
path: output/**.md
- name: Upload generated pdf files
uses: actions/upload-artifact@v3
with:
name: pdfs
path: output/**.pdf
build_and_push:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Build the container image
run: docker build .
--file Dockerfile
--tag ${REGISTRY_GHCR}/${CONTAINER_NAME}:${{ github.ref_name }}
--tag ${REGISTRY_GHCR}/${CONTAINER_NAME}:latest
--tag ${REGISTRY_QUAY}/${CONTAINER_NAME}:${{ github.ref_name }}
--tag ${REGISTRY_QUAY}/${CONTAINER_NAME}:latest
- name: Login into the GitHub Container Registry
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ${REGISTRY_GHCR} --username "${{ vars.GHCR_USER }}" --password-stdin
- name: Login into the Quay Container Registry
run: echo "${{ secrets.QUAY_ROBOT_TOKEN }}" | docker login ${REGISTRY_QUAY} --username "${{ vars.QUAY_ROBOT_NAME }}" --password-stdin
- name: Push the image into the GitHub Container Registry
run: docker push --all-tags ${REGISTRY_GHCR}/${CONTAINER_NAME}
- name: Push the image into the Quay Container Registry
run: docker push --all-tags ${REGISTRY_QUAY}/${CONTAINER_NAME}