-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: add app CI workflows * ci: trigger * ci: trigger * ci: remove app matrix for UI improvements * ci: re-add matrix * ci: checkout remote repo * ci: fix working directory * ci: fix PHP version * ci: add `fail-fast: false` to static analysis * ci: add Docker job as placeholder * ci: prefix artefacts with project name * ci: correctly placeholder various parts in the pipeline * ci: improve granularity of CI workflow * fixup! ci: improve granularity of CI workflow * fixup! ci: improve granularity of CI workflow * ci: add `continue-on-error` until static analysis is fixed * ci: add default run directory to lint/package jobs * ci: fix `git archive` command * ci: attempt to cast `should-build-*-docker` in app workflow * ci: add verbosity to static analysis to debug performance * Revert "ci: add verbosity to static analysis to debug performance" This reverts commit f64e1fa. * ci: fix artefact name * ci: remove `xdebug` extension * ci: disable static analysis for sanity * ci: revert CD workflow changes * ci: fix tar.gz upload path * ci: remove test files * ci: fix Docker job conditional * ci: add `concurrency` to Docker job
- Loading branch information
1 parent
53e7bb3
commit baa0b08
Showing
7 changed files
with
433 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Get app version | ||
|
||
inputs: | ||
project-path: | ||
description: The root path of the app project | ||
required: true | ||
ref: | ||
description: The commit reference to use as a starting point for the version | ||
required: true | ||
default: "HEAD" | ||
|
||
outputs: | ||
version: | ||
description: The app version | ||
value: ${{ steps.get-version.outputs.version }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: get-version | ||
shell: bash | ||
run: | | ||
LATEST_APP_COMMIT=$(git rev-list -1 --abbrev-commit ${{ inputs.ref }} -- ${{ inputs.project-path }}) | ||
COMMIT_RELEASE_VERSION=$(git describe --tags --abbrev=0 $LATEST_APP_COMMIT 2>/dev/null) || true | ||
LATEST_RELEASE=$(git describe --tags --abbrev=0 ${{ inputs.reference }} 2>/dev/null) || true | ||
if [[ $COMMIT_RELEASE_VERSION == $LATEST_RELEASE ]]; then | ||
TAG=$(git describe --tags --exact-match $LATEST_APP_COMMIT 2>/dev/null) || true | ||
if [[ -n $TAG ]]; then | ||
echo "version=release/$TAG" >> $GITHUB_OUTPUT | ||
else | ||
echo "version=$LATEST_APP_COMMIT" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "version=release/$LATEST_RELEASE" >> $GITHUB_OUTPUT | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Docker | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
type: string | ||
required: false | ||
project: | ||
type: string | ||
required: true | ||
should-upload-artefact-to-ecr: | ||
type: boolean | ||
required: true | ||
default: false | ||
app-artefact-name: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
check-ecr: | ||
name: Check ECR | ||
if: ${{ inputs.should-upload-artefact-to-ecr }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image-exists: ${{ steps.check-ecr.outputs.exists }} | ||
env: | ||
PROJECT: ${{ inputs.project }} | ||
OBJECT_PREFIX: ${{ inputs.app-artefact-name }} | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ vars.TF_OIDC_ROLE }} | ||
aws-region: ${{ vars.TF_AWS_REGION }} | ||
- name: Check if image already exists in ECR | ||
id: check-ecr | ||
# Check if the image already exists in ECR, so we don't have to build it again. | ||
run: exit 0 | ||
|
||
lint: | ||
name: Lint | ||
needs: | ||
- check-ecr | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && (needs.check-ecr.result == 'skipped' || !needs.check-ecr.outputs.image-exists) }} | ||
steps: | ||
- name: Lint | ||
run: exit 0 | ||
|
||
build: | ||
name: Build | ||
needs: | ||
- check-ecr | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && (needs.check-ecr.result == 'skipped' || !needs.check-ecr.outputs.image-exists) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref || null }} | ||
path: infra/docker/${{ inputs.project }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.app-artefact-name }} | ||
path: app/${{ inputs.project }} | ||
- name: Build | ||
run: exit 0 |
Oops, something went wrong.