Skip to content

Commit

Permalink
Fix CI Nits (#1144)
Browse files Browse the repository at this point in the history
This PR does a bit of upkeep on our CI:

* Builds the home app for git tags
* Adds a job to clean up home app PR images
* Adds the home app to the workflow that cleans up untagged container
images
* Adds the home app to the deploy job
* Updates Dependabot to use `development` as the base branch instead of
`main` for home app updates
* Retires the `add-issue-to-project.yml` job - this is now built-in to
the project board
* Fixes a harmless but annoying failure where the PR container image
cleanup workflow tried to cleanup non-existent MATS container images
after a home app update
* Adds CodeQL checks for our Go code
* Standardizes home app/mats app CI workflow names
  • Loading branch information
ian-noaa authored Jan 17, 2024
2 parents 81c480e + 9300ec9 commit 82479fe
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ updates:
interval: "weekly"
pull-request-branch-name:
separator: "-" # Use "-" instead of "/" in branch names to avoid issues with docker registries
target-branch: "development"
assignees:
- "ian-noaa"
16 changes: 0 additions & 16 deletions .github/workflows/add-issue-to-project.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ on:
branches: ["main", "development"]
paths:
- "home/**"
- ".github/**"
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
pull_request:
paths:
- "home/**"
- ".github/**"
workflow_dispatch:
env:
DEV_REGISTRY: ghcr.io/noaa-gsl/mats/development
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
language: [ 'javascript', 'python', 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- ceil-vis
- ceil-vis15
- ensemble
- home
- landuse
- precipAccum
- precipGauge
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/prune-home-pr-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cleanup Home App PR images

on:
pull_request:
types: [closed]
paths:
- "home/**"

jobs:
purge-images:
name: Cleanup PR images from ghcr.io
runs-on: ubuntu-latest
steps:
- name: Get tag & appname
run: |
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
- name: Cleanup images
if: ${{ (env.BRANCH != 'development') && (env.BRANCH != 'main') }} # don't prune images from the development or main branches
uses: bots-house/[email protected]
with:
owner: noaa-gsl
name: mats/development/home
token: ${{ secrets.GHCR_CLEANUP_PAT }}
tag: ${{ env.BRANCH }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Cleanup PR images
name: Cleanup MATS PR images

on:
pull_request:
types: [closed]
paths-ignore:
- "home/**"

jobs:
purge-images:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/prune-untagged-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
purge-untagged-images:
name: Delete image from ghcr.io
name: Remove untagged images from ghcr.io
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -17,6 +17,7 @@ jobs:
- ceil-vis
- ceil-vis15
- ensemble
- home
- landuse
- precipAccum
- precipGauge
Expand All @@ -32,7 +33,7 @@ jobs:
uses: snok/[email protected]
with:
image-names: mats/development/${{ matrix.app }}
cut-off: 1 day ago MST
cut-off: 1 week ago MST
account-type: org
org-name: noaa-gsl
untagged-only: true
Expand Down

0 comments on commit 82479fe

Please sign in to comment.