Skip to content

feat(terraform_docs): Add support for custom markers to better support other formats than Markdown #1150

feat(terraform_docs): Add support for custom markers to better support other formats than Markdown

feat(terraform_docs): Add support for custom markers to better support other formats than Markdown #1150

---
name: Build Dockerfile if changed and run smoke tests
on: [pull_request]
env:
IMAGE_TAG: pr-test
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
arch: [amd64, arm64]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get changed Docker related files
id: changed-files-specific
# yamllint disable-line rule:line-length
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
with:
files: |
Dockerfile
.dockerignore
tools/entrypoint.sh
.github/workflows/build-image-test.yaml
tools/*.sh
- name: Set up QEMU
if: matrix.os != 'ubuntu-latest' || matrix.arch != 'amd64'
# yamllint disable-line rule:line-length
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
with:
platforms: arm64
- name: Set up Docker Buildx
# yamllint disable-line rule:line-length
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Build if Dockerfile changed
if: steps.changed-files-specific.outputs.any_changed == 'true'
# yamllint disable-line rule:line-length
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
build-args: |
INSTALL_ALL=true
# yamllint disable-line rule:line-length
platforms: >- # Only one allowed here, see https://github.com/docker/buildx/issues/59#issuecomment-1433097926
linux/${{ matrix.arch }}
push: false
load: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
# Fix multi-platform: https://github.com/docker/buildx/issues/1533
provenance: false
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
- name: Run structure tests
if: steps.changed-files-specific.outputs.any_changed == 'true'
# yamllint disable-line rule:line-length
uses: plexsystems/container-structure-test-action@c0a028aa96e8e82ae35be556040340cbb3e280ca # v0.3.0
with:
image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
config: .github/.container-structure-test-config.yaml
- name: Dive - check image for waste files
if: steps.changed-files-specific.outputs.any_changed == 'true'
# yamllint disable-line rule:line-length
uses: MaxymVlasov/dive-action@379af3fc636888ada5899c997e8b52db6ad45023 # v1.0.1
with:
image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
config-file: ${{ github.workspace }}/.github/.dive-ci.yaml
github-token: ${{ secrets.GITHUB_TOKEN }}
# Can't build both platforms and use --load at the same time
# https://github.com/docker/buildx/issues/59#issuecomment-1433097926
- name: Build Multi-arch docker-image
if: >-
steps.changed-files-specific.outputs.any_changed == 'true'
&& matrix.os == 'ubuntu-latest'
&& matrix.arch == 'amd64'
# yamllint disable-line rule:line-length
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
build-args: |
INSTALL_ALL=true
platforms: linux/amd64,linux/arm64
push: false
tags: |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
# Fix multi-platform: https://github.com/docker/buildx/issues/1533
provenance: false
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"