2024-06-06 14:39:31 -04:00
|
|
|
name: Build Docker Images
|
2023-02-24 11:42:34 -05:00
|
|
|
# we want to be able to sort by tag name to find the newest and trace back to source control
|
|
|
|
# on every commit to main:
|
|
|
|
# frontend:main-20230223164322-b8becd1-45
|
|
|
|
# frontend:main-latest
|
|
|
|
# we settled on:
|
|
|
|
# main-2023-02-24_16-16-40
|
|
|
|
# because the labels on the docker image itself have the git sha and everything else :)
|
|
|
|
# on every tag:
|
|
|
|
# frontend:latest
|
2023-02-24 13:44:21 -05:00
|
|
|
#
|
|
|
|
# Example docker image labels:
|
|
|
|
# "Labels": {
|
|
|
|
# "description": "Software development platform for building, running, and monitoring executable diagrams",
|
|
|
|
# "org.opencontainers.image.created": "2023-02-24T16:43:00.844Z",
|
|
|
|
# "org.opencontainers.image.description": "",
|
|
|
|
# "org.opencontainers.image.licenses": "LGPL-2.1",
|
|
|
|
# "org.opencontainers.image.revision": "54064a050fbf9f366648f0f2e2c60ce244fcc421",
|
|
|
|
# "org.opencontainers.image.source": "https://github.com/sartography/spiff-arena",
|
|
|
|
# "org.opencontainers.image.title": "spiff-arena",
|
|
|
|
# "org.opencontainers.image.url": "https://github.com/sartography/spiff-arena",
|
|
|
|
# "org.opencontainers.image.version": "main-latest",
|
|
|
|
# "source": "https://github.com/sartography/spiff-arena"
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# Git tags for an image:
|
|
|
|
# curl -H "Authorization: Bearer $(echo -n $TOKEN | base64 -w0)" https://ghcr.io/v2/sartography/spiffworkflow-backend/tags/list | jq -r '.tags | sort_by(.)'
|
|
|
|
|
2023-02-24 11:42:34 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-07-29 10:39:50 -04:00
|
|
|
- keycloak-realm-with-groups
|
2024-06-06 14:37:59 -04:00
|
|
|
tags: [v*]
|
2023-02-24 11:42:34 -05:00
|
|
|
|
|
|
|
jobs:
|
2024-12-04 07:56:46 -08:00
|
|
|
create_docker_images:
|
2023-02-24 11:42:34 -05:00
|
|
|
runs-on: ubuntu-latest
|
2024-12-04 07:56:46 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- image_name: sartography/spiffworkflow-frontend
|
|
|
|
context: spiffworkflow-frontend
|
|
|
|
description: "Frontend component of SpiffWorkflow, a software development platform for building, running, and monitoring executable diagrams"
|
|
|
|
- image_name: sartography/spiffworkflow-backend
|
|
|
|
context: spiffworkflow-backend
|
|
|
|
description: "Backend component of SpiffWorkflow, a software development platform for building, running, and monitoring executable diagrams"
|
|
|
|
- image_name: sartography/connector-proxy-demo
|
|
|
|
context: connector-proxy-demo
|
|
|
|
description: "Connector proxy component of SpiffWorkflow, providing integration capabilities for external services"
|
2023-02-24 11:42:34 -05:00
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
2024-12-04 07:56:46 -08:00
|
|
|
IMAGE_NAME: ${{ matrix.image_name }}
|
Feature/interstitial summary part 3 (#367)
* throw an error if backend gives a 500 from interstitial page w/ burnettk
* turn unexpected errors for the interstitial page into event stream responses to avoid error misdirection
* pyl
* raise the api_error from the original and make the render_data method private
* Feature/interstitial summary (#337)
* * Process instance logs and messages are now components rather than pages, and are included within tabs on the process instance page, along with the diagram.
* Removed the Zoom and Move modules when showing the readonly
Diagram. Assured this readonly view is resized to fit the space when possible.
* Checkbox Widget no longer displays a duplicate label.
* CSS Tweaks
* All pages are limited to a max display width of 1440, with auto margins to center the main content on the page.
* "Show" pages, like ProcessInstanceShow, TaskShow have the primary content limited to 1000, also with auto-margins.
* Paragraphs, headings, blockquotes, list items are limited to a width of 640.
* Reduced margin bottom on all breadcrumbs.
* Slightly reduced the width and margin of tiles
* ordered lists and unordered lists show numbers and bullets now.
* End user Instructions component can, optionally, auto-collapse, so that only a portion is displayed, along with a toggle. This is how it is set up for the ProcessInstanceShow page.
* Greatly reduced the lag in the interstitial page when doing a re-direct.
* run_pyl
* kill console
* wait for permissionsLoaded too since we are using ability.can
* Previous change removed the top level Messages page - this re-adds it.
* I am always, ALWAYS shocked at how I can not wrap my head around when and where to use "useEffect".
This should cause the show/hide Instructions toggle to only show when useful.
* Minor cleanup on the process instance properties display.
* linting
---------
Co-authored-by: burnettk <burnettk@users.noreply.github.com>
* Fix a linting error.
* minor permissions related fixes for the new ui.
* Revert "Revert "Feature/better subworkflow management (#331)""
This reverts commit 48dcde8faf00241201c515b54444fe9fb373c7f4.
* do not execute tasks from the process instance show page w/ burnettk
* pyl w/ burnettk
* Very minor UI tweak to resolve a number of issues mentioned in SPIFF-316 Notion Ticket:
* Markdown links now open in a new window
* Tables on the home pages are now contained within Grids to better align them with the other content that is in a grid.
* Right aligned the "process instance list link" button to it is flush right with the table underneath
* Gave a little more breathing room the content on the info/metadata in the process instance view .
* updated docker image build action to contain the appropriate version info w/ burnettk
* properly resize to the available columns depending on s/m/l
---------
Co-authored-by: jasquat <jasquat@users.noreply.github.com>
Co-authored-by: Dan Funk <daniel.h.funk@gmail.com>
Co-authored-by: burnettk <burnettk@users.noreply.github.com>
2023-07-03 01:24:54 -04:00
|
|
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
2023-02-24 11:42:34 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2024-12-04 07:56:46 -08:00
|
|
|
security-events: write # Required for uploading Trivy scan results to GitHub Security
|
2023-02-24 11:42:34 -05:00
|
|
|
steps:
|
|
|
|
- name: Check out the repository
|
2024-02-12 15:15:20 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-12-06 10:33:54 -05:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-02-24 11:42:34 -05:00
|
|
|
- name: Log in to the Container registry
|
2024-07-23 14:29:07 +00:00
|
|
|
uses: docker/login-action@v3.3.0
|
2023-02-24 11:42:34 -05:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get current date
|
|
|
|
id: date
|
2023-03-16 23:43:59 -04:00
|
|
|
run: echo "date=$(date -u +'%Y-%m-%d_%H-%M-%S')" >> "$GITHUB_OUTPUT"
|
2023-11-08 15:55:07 -05:00
|
|
|
- name: Get short commit sha
|
|
|
|
id: commit_sha
|
2024-06-06 14:42:49 -04:00
|
|
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
|
2023-02-24 11:42:34 -05:00
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2024-11-20 14:42:18 +00:00
|
|
|
uses: docker/metadata-action@v5.6.1
|
2023-02-24 11:42:34 -05:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
2023-05-13 22:43:58 -04:00
|
|
|
labels: |
|
2024-12-04 07:56:46 -08:00
|
|
|
org.opencontainers.image.description=${{ matrix.description }}
|
2023-11-08 15:55:07 -05:00
|
|
|
org.opencontainers.image.version=${{ env.BRANCH_NAME }}-${{ steps.date.outputs.date }}-${{ steps.commit_sha.outputs.sha_short }}
|
2023-02-24 11:42:34 -05:00
|
|
|
tags: |
|
2024-06-06 14:37:59 -04:00
|
|
|
type=ref,event=branch,branch=main,suffix=-latest
|
2023-11-08 15:55:07 -05:00
|
|
|
type=ref,event=branch,suffix=-${{ steps.date.outputs.date }}-${{ steps.commit_sha.outputs.sha_short }}
|
2024-06-06 14:37:59 -04:00
|
|
|
type=ref,event=tag,enable=true,format={{version}}
|
|
|
|
type=ref,event=tag,enable=true,format=latest
|
2023-02-24 11:42:34 -05:00
|
|
|
|
2023-04-07 16:09:30 -04:00
|
|
|
- name: Write app version info
|
2024-12-04 07:56:46 -08:00
|
|
|
working-directory: ${{ matrix.context }}
|
2023-04-23 23:41:28 -04:00
|
|
|
run: echo "$DOCKER_METADATA_OUTPUT_JSON" | jq '.labels' > version_info.json
|
2024-12-04 07:56:46 -08:00
|
|
|
- name: Generate full image tag
|
|
|
|
id: full_tag
|
|
|
|
run: echo "full_tag=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ steps.date.outputs.date }}-${{ steps.commit_sha.outputs.sha_short }}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build Docker image
|
2024-11-26 15:06:46 +00:00
|
|
|
uses: docker/build-push-action@v6.10.0
|
2023-02-24 11:42:34 -05:00
|
|
|
with:
|
2024-12-04 07:56:46 -08:00
|
|
|
context: ${{ matrix.context }}
|
|
|
|
push: false # Don't push yet
|
|
|
|
load: true # Load image to local Docker daemon
|
|
|
|
tags: ${{ steps.full_tag.outputs.full_tag }}
|
2023-02-24 11:42:34 -05:00
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2024-12-05 07:12:11 -08:00
|
|
|
# While we ultimately push multi-arch images (amd64/arm64) to registries, we don't want to do that before we scan for vulns.
|
|
|
|
# The Action can only load a single arch image into the local dockerd at a time, so we only build and test one arch here.
|
|
|
|
# It's pretty likely that any vuln in amd64 is also in arm64, and vice-versa, so the trade-off seems reasonable.
|
|
|
|
platforms: linux/amd64
|
2024-12-04 07:56:46 -08:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
2023-10-24 17:14:28 -04:00
|
|
|
|
2024-12-04 07:56:46 -08:00
|
|
|
- name: Run Trivy vulnerability scanner
|
|
|
|
uses: aquasecurity/trivy-action@0.19.0
|
2023-10-24 17:14:28 -04:00
|
|
|
with:
|
2024-12-04 07:56:46 -08:00
|
|
|
image-ref: '${{ steps.full_tag.outputs.full_tag }}'
|
|
|
|
scan-type: 'image'
|
|
|
|
hide-progress: false
|
|
|
|
format: 'sarif'
|
|
|
|
output: 'trivy-results.sarif'
|
|
|
|
severity: 'CRITICAL,HIGH'
|
|
|
|
exit-code: 1 # Fail the workflow if critical or high vulnerabilities are found
|
|
|
|
timeout: 15m0s
|
|
|
|
ignore-unfixed: true
|
|
|
|
- name: Upload Trivy scan results to GitHub Security tab
|
|
|
|
uses: github/codeql-action/upload-sarif@v3
|
|
|
|
if: always() # Run even if the Trivy scan fails
|
2023-10-24 17:14:28 -04:00
|
|
|
with:
|
2024-12-04 07:56:46 -08:00
|
|
|
sarif_file: 'trivy-results.sarif'
|
2023-10-24 17:14:28 -04:00
|
|
|
|
2024-12-04 07:56:46 -08:00
|
|
|
- name: Push Docker image
|
2024-11-26 15:06:46 +00:00
|
|
|
uses: docker/build-push-action@v6.10.0
|
2023-10-24 17:14:28 -04:00
|
|
|
with:
|
2024-12-04 07:56:46 -08:00
|
|
|
context: ${{ matrix.context }}
|
2023-10-24 17:14:28 -04:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2023-12-06 10:30:44 -05:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2024-12-04 07:56:46 -08:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
2023-10-24 17:14:28 -04:00
|
|
|
- name: Adding markdown
|
|
|
|
run: echo 'TAGS ${{ steps.meta.outputs.tags }}' >> "$GITHUB_STEP_SUMMARY"
|
2024-06-06 14:37:59 -04:00
|
|
|
|
|
|
|
quickstart-guide-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2024-12-04 07:56:46 -08:00
|
|
|
needs: [create_docker_images]
|
2024-06-06 14:37:59 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Apps
|
|
|
|
run: ./bin/run_arena_with_docker_compose
|
|
|
|
- name: wait_for_backend
|
|
|
|
working-directory: ./spiffworkflow-backend
|
|
|
|
run: ./bin/wait_for_backend_to_be_up 5 8000
|
|
|
|
- name: wait_for_frontend
|
|
|
|
working-directory: ./spiffworkflow-frontend
|
|
|
|
run: ./bin/wait_for_frontend_to_be_up 5 8001
|
|
|
|
- name: wait_for_connector
|
|
|
|
working-directory: ./connector-proxy-demo
|
|
|
|
run: ./bin/wait_for_connector_to_be_up 5 8004
|
|
|
|
- name: Cypress run
|
|
|
|
uses: cypress-io/github-action@v6
|
|
|
|
with:
|
|
|
|
working-directory: ./spiffworkflow-frontend
|
|
|
|
browser: chromium
|
|
|
|
# just run one test to make sure we didn't completely break it
|
|
|
|
spec: cypress/e2e/process_groups.cy.js
|
|
|
|
env:
|
|
|
|
# pass GitHub token to allow accurately detecting a build vs a re-run build
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
CYPRESS_SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK: "false"
|
|
|
|
CYPRESS_SPIFFWORKFLOW_FRONTEND_USERNAME: "admin"
|
|
|
|
CYPRESS_SPIFFWORKFLOW_FRONTEND_PASSWORD: "admin"
|
|
|
|
SPIFFWORKFLOW_FRONTEND_PORT: 8001
|