Skip to content

Merge pull request #16 from SEMOSAN/feat/#15-config-paging #8

Merge pull request #16 from SEMOSAN/feat/#15-config-paging

Merge pull request #16 from SEMOSAN/feat/#15-config-paging #8

Workflow file for this run

name: Deploy
on:
push:
branches: [main, develop]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Build with Gradle
run: ./gradlew build -x test --no-daemon --parallel --build-cache
- name: Set image name (lowercase)
run: echo "IMAGE=ghcr.io/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.IMAGE }}:${{ github.sha }}
${{ env.IMAGE }}:latest
- name: Update image tag in manifest
run: |
sed -i "s|image: ghcr.io/.*|image: ${{ env.IMAGE }}:${{ github.sha }}|" k8s/app/deployment.yaml
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add k8s/app/deployment.yaml
git commit -m "ci: update image to ${{ github.sha }} [skip ci]"
git push