-
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.
Merge branch 'main' into add-release-please-to-cd
- Loading branch information
Showing
10 changed files
with
735 additions
and
995 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.