diff --git a/.github/workflows/ktorbase-example.yml b/.github/workflows/ktorbase-example.yml index f6cce69..2b2ebd4 100644 --- a/.github/workflows/ktorbase-example.yml +++ b/.github/workflows/ktorbase-example.yml @@ -6,6 +6,8 @@ on: - master schedule: - cron: "0 1 * * *" + release: + types: [ published ] jobs: @@ -66,7 +68,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} AWS_REGISTRY_URL: ${{ secrets.AWS_REGISTRY_URL }} - run: ./pipelines/docker-build-push-aws.sh latest + run: ./pipelines/docker-build-push-aws.sh latest ${GITHUB_SHA} - name: Deploy CloudFormation working-directory: /tmp/com.linked-planet.ktor-example @@ -74,7 +76,7 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - run: ./pipelines/deploy.sh test latest && ./pipelines/deploy-wait.sh test latest + run: ./pipelines/deploy.sh test ${GITHUB_SHA} && ./pipelines/deploy-wait.sh test ${GITHUB_SHA} - name: Run Integration Tests working-directory: /tmp/com.linked-planet.ktor-example diff --git a/.github/workflows/ktorbase.yml b/.github/workflows/ktorbase.yml index 4e0b7b9..6b9060d 100644 --- a/.github/workflows/ktorbase.yml +++ b/.github/workflows/ktorbase.yml @@ -34,6 +34,13 @@ jobs: - name: Gradle Build run: ./gradlew build + - name: Extract Version + id: extract-version + run: | + VERSION="$(./gradlew cV | grep "Project version" | cut -d ":" -f2 | xargs)" + echo "Detected version: $VERSION" + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -50,8 +57,11 @@ jobs: uses: docker/build-push-action@v3 with: context: . - push: true - tags: linkedplanet/ktorbase:latest + load: true + push: ${{ github.event_name == 'release' }} + tags: | + linkedplanet/ktorbase:latest + linkedplanet/ktorbase:${{ env.VERSION }} - name: Start KtorBase run: docker run -d -p 9090:9090 -e APPLICATION_SECRET=0000000000000000000000000000000 linkedplanet/ktorbase:latest diff --git a/build.gradle.kts b/build.gradle.kts index b194048..942d086 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,10 +7,9 @@ plugins { // derive gradle version from git tag id("pl.allegro.tech.build.axion-release") version "1.14.3" - // provide & configure tasks: dependencyUpdates, useLatestVersions + // provide & configure dependencyUpdates id("com.github.ben-manes.versions") version "0.44.0" id("se.ascp.gradle.gradle-versions-filter") version "0.1.16" - id("se.patrikerdes.use-latest-versions") version "0.2.18" } group = "com.linked-planet" diff --git a/runConfigurations/ktorbase [dependencyUpdates].run.xml b/runConfigurations/dependencyUpdates.run.xml similarity index 83% rename from runConfigurations/ktorbase [dependencyUpdates].run.xml rename to runConfigurations/dependencyUpdates.run.xml index b017764..67ef312 100644 --- a/runConfigurations/ktorbase [dependencyUpdates].run.xml +++ b/runConfigurations/dependencyUpdates.run.xml @@ -1,5 +1,5 @@ - + - \ No newline at end of file +