Skip to content

chore: update deploy #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
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
20 changes: 18 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
outputs:
environment: ${{ steps.set-github-outputs.outputs.environment }}
url: ${{ steps.set-github-outputs.outputs.url }}
steps:
-
name: Sets GitHub Outputs
id: set-github-outputs
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "environment=prod" >> "$GITHUB_OUTPUT"
echo "url=demo.api-platform.com" >> "$GITHUB_OUTPUT"
else
echo "environment=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "url=pr-${{ github.event.pull_request.number }}-demo.api-platform.com" >> "$GITHUB_OUTPUT"
fi
-
name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -51,9 +65,9 @@ jobs:
name: Generate NEXT_PUBLIC_OIDC_SERVER_URL
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "NEXT_PUBLIC_OIDC_SERVER_URL=https://demo.api-platform.com/oidc/realms/demo" >> $GITHUB_ENV
echo "NEXT_PUBLIC_OIDC_SERVER_URL=https://${{ steps.set-github-outputs.outputs.url }}/" >> $GITHUB_ENV
else
echo "NEXT_PUBLIC_OIDC_SERVER_URL=https://pr-${{ github.event.pull_request.number }}-demo.api-platform.com/oidc/realms/demo" >> $GITHUB_ENV
echo "NEXT_PUBLIC_OIDC_SERVER_URL=https://${{ steps.set-github-outputs.outputs.url }}oidc/realms/demo/" >> $GITHUB_ENV
fi
-
name: Build Docker images
Expand Down Expand Up @@ -107,6 +121,8 @@ jobs:
docker-images-version: ${{ github.sha }}
gke-cluster: api-platform-demo
gke-zone: europe-west1-c
environment: ${{ needs.build.outputs.environment }}
url: ${{ needs.build.outputs.url }}
secrets:
gke-credentials: ${{ secrets.GKE_SA_KEY }}
gke-project: ${{ secrets.GKE_PROJECT }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ on:
type: string
description: Google Kubernetes Engine Zone
required: true
environment:
type: string
description: GitHub Environment
required: true
url:
type: string
description: GitHub Environment URL
required: true
secrets:
gke-credentials:
description: Google Kubernetes Engine Credentials as JSON
Expand Down
Loading