Skip to content

Commit

Permalink
Build the containers manifest for Dependabot Docker PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Feb 23, 2022
1 parent 642f416 commit 39479f4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/dependabot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
# Map the step output to a job output for subsequent jobs
outputs:
dependency-type: ${{ steps.dependabot-metadata.outputs.dependency-type }}
package-ecosystem: ${{ steps.dependabot-metadata.outputs.package-ecosystem }}
steps:
- name: Fetch dependabot metadata
id: dependabot-metadata
Expand All @@ -25,7 +26,8 @@ jobs:
build-dependabot-changes:
runs-on: ubuntu-latest
needs: [fetch-dependabot-metadata]
if: ${{ needs.fetch-dependabot-metadata.outputs.dependency-type == 'direct:production' }}
# We only need to build the dist/ folder if the PR relates to Docker or a production NPM dependency, otherwise we don't expect changes.
if: needs.fetch-dependabot-metadata.output.package-ecosystem == 'docker' || ( needs.fetch-dependabot-metadata.output.package-ecosystem == 'npm_and_yarn' && needs.fetch-dependabot-metadata.outputs.dependency-type == 'direct:production' )
steps:
# Check out using a PAT so any pushed changes will trigger checkruns
- uses: actions/checkout@v2
Expand All @@ -45,6 +47,14 @@ jobs:
- name: Install NPM dependencies
run: npm ci

# If we're reacting to a Docker PR, we have on extra step to refresh and check in the container manifest,
# this **must** happen before rebuilding dist/ so it uses the new version of the manifest
- name: Rebuild docker/containers.json
if: needs.fetch-dependabot-metadata.output.package-ecosystem == 'docker'
run: |
npm run update-container-manifest
git add docker/containers.json
- name: Rebuild the dist/ directory
run: npm run package

Expand Down

0 comments on commit 39479f4

Please sign in to comment.