40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
name: Test Dockerfile
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
detect-changes:
|
|
# Run on `grafana/grafana` main branch, or on pull requests to prevent double-running on mirrors
|
|
name: Detect whether code changed
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
changed: ${{ steps.detect-changes.outputs.backend || steps.detect-changes.outputs.frontend || steps.detect-changes.outputs.dockerfile }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: true # required to get more history in the changed-files action
|
|
fetch-depth: 2
|
|
- name: Detect changes
|
|
id: detect-changes
|
|
uses: ./.github/actions/change-detection
|
|
with:
|
|
self: .github/workflows/pr-test-docker.yml
|
|
|
|
build-dockerfile:
|
|
needs: detect-changes
|
|
if: needs.detect-changes.outputs.changed == 'true'
|
|
runs-on: ubuntu-x64-large-io
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
- uses: docker/setup-docker-action@3fb92d6d9c634363128c8cce4bc3b2826526370a # v4
|
|
- name: Build Dockerfile
|
|
run: make build-docker-full
|