Skip to content
Draft
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
179 changes: 67 additions & 112 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,46 @@ name: "Build Docker Images"
on:
workflow_dispatch:
inputs:
baseTarget:
description: "Used to set your target for the base image"
components:
default: '["base", "solr", "web", "worker"]'
description: "Used to set your target for the components"
required: false
type: string
image_name:
description: "Docker image name part. Fills in ghcr.io/IMAGE_NAME. Typically this is the `repo_name`, but in some projects it might be `repo_name/sub_name`"
type: string
platforms:
default: "linux/amd64,linux/arm64"
description: "Which platforms you would like built through CI"
type: string
solrTarget:
description: "Used to set your target for the solr image"
os:
default: '["ubuntu-latest", "ubuntu-24.04-arm"]'
description: "Used to set your target for the operating system"
required: false
type: string
subdir:
default: '.'
default: "."
type: string
tag:
required: false
type: string
webTarget:
description: "Used to set your target for the web image"
required: false
type: string
workerTarget:
description: "Used to set your target for the worker image"
required: false
type: string
workflow_call:
inputs:
baseTarget:
description: "Used to set your target for the base image"
components:
default: '["base", "solr", "web", "worker"]'
description: "Used to set your target for the components"
required: false
type: string
image_name:
description: "Docker image name part. Fills in ghcr.io/IMAGE_NAME. Typically this is the `repo_name`, but in some projects it might be `repo_name/sub_name`"
type: string
platforms:
default: "linux/amd64,linux/arm64"
description: "Which platforms you would like built through CI"
type: string
solrTarget:
description: "Used to set your target for the solr image"
os:
default: '["ubuntu-latest", "ubuntu-24.04-arm"]'
description: "Used to set your target for the operating system"
required: false
type: string
subdir:
default: '.'
default: "."
type: string
tag:
required: false
type: string
webTarget:
description: "Used to set your target for the web image"
required: false
type: string
workerTarget:
description: "Used to set your target for the worker image"
required: false
type: string

env:
REGISTRY: ghcr.io
Expand All @@ -70,22 +50,34 @@ env:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
component: ${{fromJson(inputs.components)}}
os: ${{fromJson(inputs.os)}}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Set platform from matrix
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
echo "PLATFORM_TAG=amd64" >> $GITHUB_ENV
else
echo "PLATFORM_TAG=arm64" >> $GITHUB_ENV
fi
- id: setup
name: Setup
uses: notch8/actions/setup-env@v1.0.4
uses: notch8/actions/setup-env@enter_the_matrix
with:
tag: ${{ inputs.tag }}
image_name: ${{ inputs.image_name }}
token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
subdir: ${{ inputs.subdir }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -95,79 +87,42 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_step == 'build' }}
with:
limit-access-to-actor: true
- name: Retag action for base
if: ${{ inputs.baseTarget != '' }}
id: meta-base
uses: docker/metadata-action@v4.1.1
with:
images: |
name=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}/base
tags: |
type=raw,value=latest,enable={{is_default_branch}}
- name: Retag action for web
if: ${{ inputs.webTarget != '' }}
id: meta-web
uses: docker/metadata-action@v4.1.1
with:
images: |
name=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
- name: Retag action for worker
if: ${{ inputs.workerTarget != '' }}
id: meta-worker
uses: docker/metadata-action@v4.1.1
with:
images: |
name=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}/worker
tags: |
type=raw,value=latest,enable={{is_default_branch}}
- name: Retag action for solr
if: ${{ inputs.solrTarget != '' }}
id: meta-solr
uses: docker/metadata-action@v4.1.1
- name: Build Prep
run: |
echo "Preparing build environment..."
cd ${{ inputs.subdir }};
[ -f "db/schema.rb" ] && chmod 777 db/schema.rb;
[ -f "bin/checkout_all.sh" ] && ./bin/checkout_all.sh;
- name: Build and push ${{ matrix.component }} on ${{ matrix.os }}
uses: docker/build-push-action@v3
with:
images: |
name=${{ env.REGISTRY }}/${{ env.REPO_LOWER }}/solr
context: ${{ inputs.subdir }}
platforms: linux/${{ env.PLATFORM_TAG }}
target: ${{ matrix.component }}
cache-from: |
type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.component }}:latest
cache-to: type=inline
push: true
tags: |
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push base
if: ${{ inputs.baseTarget != '' }}
uses: notch8/actions/build-and-push@v1.0.4
with:
type: base
location: /base
subdir: ${{ inputs.subdir }}
tags: ${{ steps.meta-base.outputs.tags }}
- name: Build and push web and worker
if: ${{ inputs.webTarget != '' && inputs.workerTarget != '' }}
uses: notch8/actions/build-and-push@v1.0.4
with:
type: web,worker
location: ""
subdir: ${{ inputs.subdir }}
tags: ${{ steps.meta-base.outputs.tags }}
- name: Build and push web
if: ${{ inputs.webTarget != '' && inputs.workerTarget == '' }}
uses: notch8/actions/build-and-push@v1.0.4
with:
type: web
location: ""
subdir: ${{ inputs.subdir }}
tags: ${{ steps.meta-base.outputs.tags }}
- name: Build and push worker
if: ${{ inputs.workerTarget != '' && inputs.webTarget == '' }}
uses: notch8/actions/build-and-push@v1.0.4
with:
type: worker
location: /worker
subdir: ${{ inputs.subdir }}
tags: ${{ steps.meta-worker.outputs.tags }}
- name: Build and push solr
if: ${{ inputs.solrTarget != '' }}
uses: notch8/actions/build-and-push@v1.0.4
${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.component }}:${{ env.TAG }}-${{ env.PLATFORM_TAG }}

push:
needs: build
runs-on: ubuntu-latest
steps:
- id: setup
name: Setup
uses: notch8/actions/setup-env@enter_the_matrix
with:
type: solr
location: /solr
tag: ${{ inputs.tag }}
image_name: ${{ inputs.image_name }}
token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
subdir: ${{ inputs.subdir }}
tags: ${{ steps.meta-solr.outputs.tags }}
- name: Create multiarch manifests
run: |
components_list=$(echo '${{ inputs.components }}' | jq -r '.[]' | tr '\n' ' ')
for component in $components_list; do
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$component:${{ env.TAG }} \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$component:${{ env.TAG }}-amd64 \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$component:${{ env.TAG }}-arm64
done
8 changes: 4 additions & 4 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
required: false
type: string
subdir:
default: '.'
default: "."
type: string
tag:
required: false
Expand All @@ -36,7 +36,7 @@ on:
required: false
type: string
subdir:
default: '.'
default: "."
type: string
tag:
required: false
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
steps:
- id: setup
name: Setup
uses: notch8/actions/setup-env@v1.0.4
uses: notch8/actions/setup-env@enter_the_matrix
with:
tag: ${{ inputs.tag }}
token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -131,4 +131,4 @@ jobs:
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'cypress/results/results-*.xml'
report_paths: "cypress/results/results-*.xml"
36 changes: 2 additions & 34 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,28 @@ name: "Lint for Rails Projects"
on:
workflow_dispatch:
inputs:
baseTarget:
description: "Used to set your target for the base image"
required: false
type: string
rubocop_cmd:
default: bundle exec rubocop --parallel --format progress
required: false
type: string
solrTarget:
description: "Used to set your target for the solr image"
required: false
type: string
subdir:
default: "."
type: string
tag:
required: false
type: string
webTarget:
description: "Used to set your target for the web image"
required: false
type: string
workerTarget:
description: "Used to set your target for the worker image"
required: false
type: string
workflow_call:
inputs:
baseTarget:
description: "Used to set your target for the base image"
required: false
type: string
rubocop_cmd:
default: bundle exec rubocop --parallel --format progress --format junit --out rubocop.xml --display-only-failed
required: false
type: string
solrTarget:
description: "Used to set your target for the solr image"
required: false
type: string
subdir:
default: "."
type: string
tag:
required: false
type: string
webTarget:
description: "Used to set your target for the web image"
required: false
type: string
workerTarget:
description: "Used to set your target for the worker image"
required: false
type: string

env:
REGISTRY: ghcr.io
Expand All @@ -68,7 +36,7 @@ jobs:
steps:
- id: setup
name: Setup
uses: notch8/actions/setup-env@v1.0.4
uses: notch8/actions/setup-env@enter_the_matrix
with:
tag: ${{ inputs.tag }}
token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
Expand All @@ -94,7 +62,7 @@ jobs:
"${{ inputs.rubocop_cmd }}"
- id: after_care
name: Upload Logs and Results
uses: notch8/actions/after-care@v1.0.4
uses: notch8/actions/after-care@enter_the_matrix
if: always()
with:
reports: "rubocop*.xml"
12 changes: 2 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: "Rspec for Rails Apps"
on:
workflow_dispatch:
inputs:
baseTarget:
description: "Used to set your target for the base image"
required: false
type: string
confdir:
description: "Solr conf/config directory"
required: false
Expand Down Expand Up @@ -50,10 +46,6 @@ on:
type: string
workflow_call:
inputs:
baseTarget:
description: "Used to set your target for the base image"
required: false
type: string
confdir:
required: false
type: string
Expand Down Expand Up @@ -113,7 +105,7 @@ jobs:
steps:
- id: setup
name: Setup
uses: notch8/actions/setup-env@v1.0.4
uses: notch8/actions/setup-env@enter_the_matrix
with:
tag: ${{ inputs.tag }}
token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -175,7 +167,7 @@ jobs:
fi
- id: after_care
name: Upload Logs and Results
uses: notch8/actions/after-care@v1.0.4
uses: notch8/actions/after-care@enter_the_matrix
if: always()
with:
reports: "rspec-*.xml"
2 changes: 1 addition & 1 deletion .github/workflows/update-deploy-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- id: setup
name: Setup
uses: notch8/actions/setup-env@v1.0.4
uses: notch8/actions/setup-env@enter_the_matrix
with:
token: ${{ secrets.CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}

Expand Down
Loading