Skip to content

Commit

Permalink
github actions updates + dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
soletsdev committed Sep 26, 2024
1 parent ee870b1 commit 5d0cc8f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
12 changes: 6 additions & 6 deletions .github/workflows/ci-api-build.and.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
working-directory: api

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: oracle
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Run unit tests
run: mvn -f pom.xml clean package
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand All @@ -54,7 +54,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@0.12.0
uses: aquasecurity/trivy-action@0.24.0
with:
scan-type: 'fs'
ignore-unfixed: true
Expand All @@ -63,6 +63,6 @@ jobs:
severity: 'CRITICAL'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
9 changes: 4 additions & 5 deletions .github/workflows/deploy-to.openshift-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ on:
jobs:
build-and-deploy-dev:
name: Build and deploy to OpenShift DEV
# ubuntu-20.04 can also be used.
runs-on: ubuntu-22.04
environment: dev

Expand All @@ -57,7 +56,7 @@ jobs:

steps:
- name: Check for required secrets
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const secrets = {
Expand Down Expand Up @@ -91,7 +90,7 @@ jobs:
core.info(`✅ All the required secrets are set`);
}
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Determine image tags
if: env.IMAGE_TAGS == ''
Expand Down Expand Up @@ -136,7 +135,7 @@ jobs:
oc: 4

# https://github.com/redhat-actions/oc-login#readme
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Deploy API
run: |
Expand All @@ -163,6 +162,6 @@ jobs:
# Get status, returns 0 if rollout is successful
oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }}
- name: ZAP Scan
uses: zaproxy/action-api-scan@v0.7.0
uses: zaproxy/action-api-scan@v0.8.0
with:
target: 'https://${{ env.APP_NAME }}-${{ env.OPENSHIFT_NAMESPACE_DEV }}.apps.silver.devops.gov.bc.ca/v3/api-docs'
7 changes: 3 additions & 4 deletions .github/workflows/deploy-to.openshift-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ on:
jobs:
openshift-ci-cd:
name: Deploy to OpenShift PROD
# ubuntu-20.04 can also be used.
runs-on: ubuntu-22.04
environment: production

Expand All @@ -51,7 +50,7 @@ jobs:

steps:
- name: Check for required secrets
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const secrets = {
Expand Down Expand Up @@ -89,7 +88,7 @@ jobs:
}

- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
Expand All @@ -101,7 +100,7 @@ jobs:
oc: 4

# https://github.com/redhat-actions/oc-login#readme
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Deploy API
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-to.openshift-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

steps:
- name: Check for required secrets
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const secrets = {
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
}
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
Expand Down Expand Up @@ -129,6 +129,6 @@ jobs:
oc rollout status dc/${{ env.SPRING_BOOT_IMAGE_NAME }}
- name: ZAP Scan
uses: zaproxy/action-api-scan@v0.7.0
uses: zaproxy/action-api-scan@v0.8.0
with:
target: 'https://${{ env.APP_NAME }}-${{ env.OPENSHIFT_NAMESPACE_TEST }}.apps.silver.devops.gov.bc.ca/v3/api-docs'
6 changes: 3 additions & 3 deletions .github/workflows/tag-create.git.and.imagestream.tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create tag
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
Expand All @@ -52,7 +52,7 @@ jobs:
oc: 4

# https://github.com/redhat-actions/oc-login#readme
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Tag in OpenShift
run: |
set -eux
Expand Down

0 comments on commit 5d0cc8f

Please sign in to comment.