Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Auth CI/CD

on:
pull_request:
push:
branches: [main, master, feature/spring-microservices, chore/registry-ci]

permissions:
contents: read
packages: write
security-events: write

env:
IMAGE: ghcr.io/microsserv52/auth

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: maven
- run: ./mvnw --batch-mode validate

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
git diff --check
! grep -R -n -E '^(<<<<<<<|=======|>>>>>>>)' --exclude-dir=.git .

test:
runs-on: ubuntu-latest
needs: [lint, format]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: maven
- run: ./mvnw --batch-mode --no-transfer-progress test

quality:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: maven
- run: ./mvnw --batch-mode --no-transfer-progress verify

security:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with:
languages: java
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3

build:
runs-on: ubuntu-latest
needs: [quality, security]
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.IMAGE }}:sha-${{ github.sha }}
${{ env.IMAGE }}:latest
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ Set `ACCOUNT_URL` to the Account service URL. `JWT_SECRET` must be identical
in Auth, Gateway, Account, and Order service. `INTERNAL_SERVICE_SECRET` must
match Account.

## Environment variables

Set `ACCOUNT_URL`, `JWT_SECRET`, `INTERNAL_SERVICE_SECRET`, and
`ACCESS_TOKEN_EXPIRATION_SECONDS` in the root platform `.env` locally. In
GitHub Actions, use repository secrets; in Kubernetes, use ConfigMap values
for URLs and `platform-secrets` for credentials.

| Variable | Purpose |
| --- | --- |
| `ACCOUNT_URL` | Account service base URL |
| `JWT_SECRET` | Shared JWT HMAC secret |
| `INTERNAL_SERVICE_SECRET` | Account credential lookup secret |
| `ACCESS_TOKEN_EXPIRATION_SECONDS` | Access-token lifetime |

## GitHub Actions secrets

Add these under **Settings → Secrets and variables → Actions** in
Expand Down
Loading