feat: smarter workflows #97
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
name: PR | |
on: | |
pull_request: | |
branches: [main] | |
concurrency: | |
# PR open and close use the same group, allowing only one at a time | |
group: pr-${{ github.workflow }}-${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
scrub: | |
name: Scrub for changed Dockerfiles | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Dockerfiles | |
id: dockerfiles | |
run: | | |
# Get all Dockerfiles that have changed | |
git fetch origin ${{ inputs.diff_branch }} | |
git diff --name-only ${{ github.head_ref || github.ref_name }} ${{ github.event.repository.default_branch }} | |
# DOCKERFILES=$(git diff --name-only ${{ github.head_ref || github.ref_name }} ${{ github.event.repository.default_branch }} | grep -E '^[^/]+/[^/]+/Dockerfile$' | sort -u) | |
# echo "dockerfiles=${DOCKERFILES}" >> $GITHUB_OUTPUT | |
# echo -e "Dockerfiles: \n $DOCKERFILES" | |
# # https://github.com/bcgov-nr/action-builder-ghcr | |
# builds: | |
# name: Builds | |
# if: "!github.event.pull_request.head.repo.fork" | |
# permissions: | |
# packages: write | |
# runs-on: ubuntu-22.04 | |
# strategy: | |
# matrix: | |
# include: | |
# - package: bitnami/pgpool | |
# major_tag: 4 | |
# - package: bitnami/postgresql | |
# major_tag: 12 | |
# - package: bitnami/postgresql | |
# major_tag: 13 | |
# - package: bitnami/postgresql | |
# major_tag: 14 | |
# - package: bitnami/postgresql | |
# major_tag: 15 | |
# - package: bitnami/postgresql | |
# major_tag: 16 | |
# - package: bitnami/postgresql-ha | |
# major_tag: 12 | |
# - package: bitnami/postgresql-ha | |
# major_tag: 13 | |
# - package: bitnami/postgresql-ha | |
# major_tag: 14 | |
# - package: bitnami/postgresql-ha | |
# major_tag: 15 | |
# - package: bitnami/postgresql-ha | |
# major_tag: 16 | |
# - package: mongo | |
# major_tag: 6 | |
# - package: mongo | |
# major_tag: 7 | |
# - package: postgres | |
# major_tag: 12 | |
# - package: postgres | |
# major_tag: 13 | |
# - package: postgres | |
# major_tag: 14 | |
# - package: postgres | |
# major_tag: 15 | |
# - package: postgres | |
# major_tag: 16 | |
# timeout-minutes: 10 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Get tag | |
# id: tag | |
# run: | | |
# TAG=$(grep '^FROM' ${{ matrix.package }}/${{ matrix.major_tag }}/Dockerfile | cut -d':' -f2) | |
# echo "full_tag=${TAG}" >> $GITHUB_OUTPUT | |
# - name: Build or import | |
# uses: bcgov-nr/[email protected] | |
# with: | |
# build_context: ${{ matrix.package }}/${{ matrix.major_tag }} | |
# package: ${{ matrix.package }} | |
# tag: ${{ steps.tag.outputs.full_tag }} | |
# triggers: ${{ matrix.package}}/${{ matrix.triggers }} | |
# pr-description-add: | |
# name: PR Description Add | |
# needs: [builds] | |
# runs-on: ubuntu-22.04 | |
# permissions: | |
# pull-requests: write | |
# timeout-minutes: 1 | |
# steps: | |
# - uses: bcgov-nr/[email protected] | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# add_markdown: | | |
# --- | |
# Thanks for the PR! | |
# Any new images should be viewable with [our repo packages](https://github.com/orgs/bcgov/packages?repo_name=nr-containers). :) |