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

chore(deps): update gradle version #382

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/actions/analysis/security/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ runs:
uses: github/codeql-action/[email protected]
with:
sarif_file: build/reports/detekt/detekt.sarif
checkout_path: ${{ github.workspace }}
token: ${{ inputs.token }}
category: static-code-analysis
112 changes: 0 additions & 112 deletions .github/actions/docker/action.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/actions/docker/backend/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Package and Publish Backend 📦
description: |
This workflow is responsible for packaging and publishing the backend application
to the container registry. It also performs vulnerability scanning.

inputs:
deliver:
description: 'Deliver backend to production'
required: true
default: 'true'
docker_username:
description: 'The username for Docker Hub'
required: true
docker_password:
description: 'The password for Docker Hub'
required: true
version:
description: 'The version of the backend'
required: true
ci_github_token:
description: 'GITHUB_TOKEN with permissions to push to the container registry'
required: true
gradle-encryption-key:
description: 'The encryption key to use for the gradle cache'
required: true

runs:
using: composite
steps:
- name: Install Java Tools & Dependencies
uses: ./.github/actions/install/java
with:
java-version: 21
gradle-encription-key: ${{ inputs.gradle-encryption-key }}

- name: Cache Gradle Dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Execute Gradle build
run: |
chmod +x gradlew
./gradlew assemble
./gradlew bootBuildImage -x test
shell: bash

- name: 🪄 Scan Docker images for vulnerabilities
uses: aquasecurity/[email protected]
with:
image-ref: ghcr.io/dallay/lyra:latest
format: sarif
output: trivy-lyra-report.sarif
severity: HIGH,CRITICAL
ignore-unfixed: true
cache-dir: /tmp/trivy-cache-lyra

- name: ⇪ Upload Trivy Scan Report
uses: actions/upload-artifact@v3
with:
name: trivy-lyra-report
path: trivy-lyra-report.sarif

- name: 🐳 Authenticate to Docker Hub and GHCR
run: |
echo ${{ inputs.ci_github_token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
echo ${{ inputs.docker_password }} | docker login docker.io -u ${{ inputs.docker_username }} --password-stdin
shell: bash

- name: 🐳 Push Docker image to GHCR and Docker Hub
if: ${{ inputs.deliver }}
run: |
docker push --all-tags ${{ inputs.docker_username }}/lyra
docker push --all-tags ghcr.io/dallay/lyra
shell: bash
67 changes: 0 additions & 67 deletions .github/actions/docker/dockerhub/action.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/actions/docker/frontend/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Package and Publish Frontend 📦
description: |
This composite action packages and publishes the frontend application
(lyra-app and lyra-landing-page) to the container registry. It also performs vulnerability scanning.

inputs:
deliver:
description: 'Deliver frontend to production'
required: true
default: 'true'
docker_username:
description: 'The username for Docker Hub'
required: true
docker_password:
description: 'The password for Docker Hub'
required: true
version:
description: 'The version of the frontend'
required: true
ci_github_token:
description: 'GITHUB_TOKEN with permissions to push to the container registry'
required: true
target:
description: 'The target image to build (lyra-app, lyra-landing-page)'
required: true

runs:
using: composite
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Authenticate to Docker Hub and GHCR
run: |
echo ${{ inputs.ci_github_token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
echo ${{ inputs.docker_password }} | docker login docker.io -u ${{ inputs.docker_username }} --password-stdin
shell: bash

- name: Cache Docker layers
id: cache
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build and Push Docker images
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
target: ${{ inputs.target }}
push: ${{ inputs.deliver }}
tags: |
ghcr.io/dallay/${{ inputs.target }}:${{ inputs.version }},
ghcr.io/dallay/${{ inputs.target }}:latest,
docker.io/${{ inputs.target }}:${{ inputs.version }},
docker.io/${{ inputs.target }}:latest
cache-from: type=registry,ref=ghcr.io/dallay/${{ inputs.target }}:cache
cache-to: type=registry,ref=ghcr.io/dallay/${{ inputs.target }}:cache,mode=max

- name: 🪄 Scan Docker images for vulnerabilities
uses: aquasecurity/[email protected]
with:
image-ref: ghcr.io/dallay/${{ inputs.target }}:latest
format: sarif
output: trivy-${{ inputs.target }}-report.sarif
severity: HIGH,CRITICAL
ignore-unfixed: true
cache-dir: /tmp/trivy-cache-${{ inputs.target }}

- name: ⇪ Upload Trivy Scan Report
uses: actions/upload-artifact@v3
with:
name: trivy-${{ inputs.target }}-report
path: trivy-${{ inputs.target }}-report.sarif
Loading
Loading