Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 61a3b65

Browse files
authored
Merge pull request #12 from linked-planet/deployment-fixes
Deployment fixes
2 parents 2ea0271 + f7867d2 commit 61a3b65

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.github/workflows/ktorbase-example.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- master
77
schedule:
88
- cron: "0 1 * * *"
9+
release:
10+
types: [ published ]
911

1012
jobs:
1113

@@ -66,15 +68,15 @@ jobs:
6668
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6769
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
6870
AWS_REGISTRY_URL: ${{ secrets.AWS_REGISTRY_URL }}
69-
run: ./pipelines/docker-build-push-aws.sh latest
71+
run: ./pipelines/docker-build-push-aws.sh latest ${GITHUB_SHA}
7072

7173
- name: Deploy CloudFormation
7274
working-directory: /tmp/com.linked-planet.ktor-example
7375
env:
7476
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
7577
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7678
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
77-
run: ./pipelines/deploy.sh test latest && ./pipelines/deploy-wait.sh test latest
79+
run: ./pipelines/deploy.sh test ${GITHUB_SHA} && ./pipelines/deploy-wait.sh test ${GITHUB_SHA}
7880

7981
- name: Run Integration Tests
8082
working-directory: /tmp/com.linked-planet.ktor-example

.github/workflows/ktorbase.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ jobs:
3434
- name: Gradle Build
3535
run: ./gradlew build
3636

37+
- name: Extract Version
38+
id: extract-version
39+
run: |
40+
VERSION="$(./gradlew cV | grep "Project version" | cut -d ":" -f2 | xargs)"
41+
echo "Detected version: $VERSION"
42+
echo "VERSION=$VERSION" >> $GITHUB_ENV
43+
3744
- name: Set up QEMU
3845
uses: docker/setup-qemu-action@v2
3946

@@ -50,8 +57,11 @@ jobs:
5057
uses: docker/build-push-action@v3
5158
with:
5259
context: .
53-
push: true
54-
tags: linkedplanet/ktorbase:latest
60+
load: true
61+
push: ${{ github.event_name == 'release' }}
62+
tags: |
63+
linkedplanet/ktorbase:latest
64+
linkedplanet/ktorbase:${{ env.VERSION }}
5565
5666
- name: Start KtorBase
5767
run: docker run -d -p 9090:9090 -e APPLICATION_SECRET=0000000000000000000000000000000 linkedplanet/ktorbase:latest

build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ plugins {
77
// derive gradle version from git tag
88
id("pl.allegro.tech.build.axion-release") version "1.14.3"
99

10-
// provide & configure tasks: dependencyUpdates, useLatestVersions
10+
// provide & configure dependencyUpdates
1111
id("com.github.ben-manes.versions") version "0.44.0"
1212
id("se.ascp.gradle.gradle-versions-filter") version "0.1.16"
13-
id("se.patrikerdes.use-latest-versions") version "0.2.18"
1413
}
1514

1615
group = "com.linked-planet"

runConfigurations/ktorbase [dependencyUpdates].run.xml renamed to runConfigurations/dependencyUpdates.run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="ktorbase [dependencyUpdates]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
2+
<configuration default="false" name="dependencyUpdates" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
33
<ExternalSystemSettings>
44
<option name="executionName" />
55
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -20,4 +20,4 @@
2020
<DebugAllEnabled>false</DebugAllEnabled>
2121
<method v="2" />
2222
</configuration>
23-
</component>
23+
</component>

0 commit comments

Comments
 (0)