Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: smarter workflows #53

Merged
merged 55 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
be4f651
ci: scrub for changed Dockerfiles
DerekRoberts Nov 15, 2023
8481271
chore(deps): update bitnami/postgresql docker tag to v16.1.0
renovate[bot] Nov 15, 2023
6b5b42b
Test
DerekRoberts Nov 15, 2023
6c97a5a
Test
DerekRoberts Nov 15, 2023
d04307f
Test
DerekRoberts Nov 15, 2023
01520de
Test
DerekRoberts Nov 15, 2023
1dee012
Test
DerekRoberts Nov 15, 2023
8ba77f2
Test
DerekRoberts Nov 15, 2023
602ed1c
Test
DerekRoberts Nov 15, 2023
22d3302
Test
DerekRoberts Nov 15, 2023
d76726f
Test
DerekRoberts Nov 15, 2023
3fbca18
Test
DerekRoberts Nov 15, 2023
f438f6a
.github/Test
DerekRoberts Nov 15, 2023
e121afe
.github/Test
DerekRoberts Nov 15, 2023
0d1b4fb
.github/Test
DerekRoberts Nov 15, 2023
3da3f92
.github/Test
DerekRoberts Nov 15, 2023
cb2e431
.github/Test
DerekRoberts Nov 15, 2023
ad38355
.github/Test
DerekRoberts Nov 15, 2023
dc09b04
.github/Test
DerekRoberts Nov 15, 2023
cd8cc11
Test
DerekRoberts Nov 15, 2023
a147c54
Fix regex
DerekRoberts Nov 15, 2023
d46728c
Array
DerekRoberts Nov 15, 2023
1ccbb18
Test
DerekRoberts Nov 16, 2023
583adc1
Test
DerekRoberts Nov 16, 2023
f88c27a
Test
DerekRoberts Nov 16, 2023
2ad5e77
Test
DerekRoberts Nov 16, 2023
ce8de87
Test
DerekRoberts Nov 16, 2023
e129c27
Test
DerekRoberts Nov 16, 2023
e822a7b
Test
DerekRoberts Nov 16, 2023
63db7c9
Test
DerekRoberts Nov 16, 2023
51065d9
Test
DerekRoberts Nov 16, 2023
5bea739
Check if this actually worked
DerekRoberts Nov 16, 2023
2784d3a
Test
DerekRoberts Nov 16, 2023
2e910d4
Test
DerekRoberts Nov 16, 2023
1f57762
Test
DerekRoberts Nov 16, 2023
91fa634
Test
DerekRoberts Nov 16, 2023
16b84b1
Test
DerekRoberts Nov 16, 2023
f367059
Test
DerekRoberts Nov 16, 2023
aa259be
Try passing JSON to builder
DerekRoberts Nov 16, 2023
522d519
Drop extra escape characters
DerekRoberts Nov 16, 2023
76b7921
Drop extra escape characters
DerekRoberts Nov 16, 2023
7605c1c
More escape characters adventures
DerekRoberts Nov 16, 2023
75ded23
More escape characters adventures
DerekRoberts Nov 16, 2023
8d8ee84
More escape characters adventures
DerekRoberts Nov 16, 2023
703710c
More escape characters adventures
DerekRoberts Nov 16, 2023
2d60f6f
Cleanup
DerekRoberts Nov 16, 2023
00f4e4c
Comments and testing
DerekRoberts Nov 16, 2023
867bec2
More escape characters adventures
DerekRoberts Nov 16, 2023
a751b67
More escape characters adventures
DerekRoberts Nov 16, 2023
dbf2e0b
More escape characters adventures
DerekRoberts Nov 16, 2023
26c4e08
More escape characters adventures
DerekRoberts Nov 16, 2023
71a16fa
Now more complicated
DerekRoberts Nov 16, 2023
b224919
Reduce changed containers
DerekRoberts Nov 16, 2023
1a05970
Cleanup
DerekRoberts Nov 16, 2023
d85fee6
Simplify
DerekRoberts Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 29 additions & 37 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,44 @@ concurrency:
cancel-in-progress: true

jobs:
scrub:
name: Scrub for changed Dockerfiles
runs-on: ubuntu-22.04
outputs:
json: ${{ steps.dockerfiles.outputs.json }}
steps:
- uses: actions/checkout@v4
- name: Get Dockerfiles
id: dockerfiles
run: |
# Fetch default_branch (usually main)
git fetch origin ${{ github.event.repository.default_branch }}

# Get changed Dockerfiles, create JSON object for the builder
DOCKERFILES=($(git diff --name-only origin/${{ github.event.repository.default_branch }} | grep -E '^.*/.*/Dockerfile$' | sort -u))
LIST=$(
for d in "${DOCKERFILES[@]}"; do
BASE=${d%/*}
echo "{\"package\": \"${BASE%/*}\", \"major_tag\": \"${BASE##*/}\"},"
done
)

# Clip extra comma and send to output
JSON=$(echo [$LIST] | sed 's/\(.*\),/\1/')
echo "json=${JSON}"
echo "json=${JSON}" >> $GITHUB_OUTPUT

# https://github.com/bcgov-nr/action-builder-ghcr
builds:
name: Builds
needs: [scrub]
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
include: ${{ fromJSON(needs.scrub.outputs.json) }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion bitnami/postgresql/16/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bitnami/postgresql:16.0.0
FROM bitnami/postgresql:16.1.0

# Health check and non-privileged user
HEALTHCHECK --interval=15s --timeout=5s --retries=3 CMD [ "pg_isready" ]
Expand Down