Making adding new images to the github actions easier #164
Workflow file for this run
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
# Candace Savonen Jan 2025 | ||
name: Pull Request | ||
on: | ||
pull_request: | ||
branches: [ main, staging ] | ||
jobs: | ||
dockerfile-check: | ||
name: Test changed Dockerfile - ${{ matrix.config.dir }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {dir: base_ottr, name: 'jhudsl/base_ottr'} | ||
- {dir: ottrpal, name: 'jhudsl/ottrpal'} | ||
- {dir: bioconductor, name: 'jhudsl/ottr_bioconductor'} | ||
- {dir: ottr_website, name: 'jhudsl/ottr_website'} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get specific changed files | ||
id: image_name | ||
uses: tj-actions/changed-files@v14.5 | ||
with: | ||
files: ${{ matrix.config.dir }}/* | ||
- run: | | ||
echo ${{ steps.image_name.outputs.any_changed }} | ||
echo ${{ matrix.config.dir }} | ||
outputs: | ||
any_changed: "${{ steps.image_name.outputs.any_changed }}" | ||
build-it: | ||
name: Build it | ||
needs: dockerfile-check | ||
if: ${{needs.dockerfile-check.outputs.any_changed == 'true'}} | ||
uses: jhudsl/ottr-docker/.github/workflows/docker-test.yml@main | ||
Check failure on line 47 in .github/workflows/pull_request.yml GitHub Actions / Pull RequestInvalid workflow file
|
||
with: | ||
directory: ${{ matrix.config.dir }} | ||
tag: ${{ matrix.config.name }} | ||
dockerhubpush: false |