Skip to content

Bumping docker java version #5

Bumping docker java version

Bumping docker java version #5

Workflow file for this run

name: build
on: push
jobs:
run-tests:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgresql
POSTGRES_PASSWORD: postgresql
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- uses: ./.github/actions/database-support
- name: migrate test database
run: |
psql --host localhost --username postgresql < databases/create_databases.sql
/usr/local/bin/flyway -user=initialdev -password=initialdev -url="jdbc:postgresql://localhost:5432/example_test" -locations=filesystem:databases/example migrate
env:
PGPASSWORD: postgresql
- name: "build"
run: ./gradlew build
- uses: actions/upload-artifact@v4
with:
name: webapp-all.jar
path: applications/webapp/build/libs/webapp-all.jar
retention-days: 1
artifact-registry:
runs-on: ubuntu-latest
needs: [ run-tests ]
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: webapp-all.jar
path: applications/webapp/build/libs
- name: "pack"
run: |
docker build -t us-central1-docker.pkg.dev/${{ secrets.GOOGLE_PROJECT_ID }}/basic-ktor-project-review/basic-ktor-project:${{ github.sha }} . \
--platform linux/amd64
cloud-sql:
runs-on: ubuntu-latest
needs: [ artifact-registry ]
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/database-support
- name: "migrate"
run: |
echo cloud-sql-proxy --port 6000 ${{ secrets.GOOGLE_PROJECT_ID }}:us-central1:basic-ktor-project-review &
sleep 8
env:
PGPASSWORD: ${{ secrets.REVIEW_DATABASE_PASSWORD }}
cloud-run:
runs-on: ubuntu-latest
needs: [ cloud-sql ]
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
- name: "deploy"
run: |-
echo gcloud run deploy basic-ktor-project-review \
--image us-central1-docker.pkg.dev/${{ secrets.GOOGLE_PROJECT_ID }}/basic-ktor-project-revbiew/basic-ktor-project:${{ github.sha }} \
--region us-central1 \
--platform managed