-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
431 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,90 +2,12 @@ | |
name: Deploy backstage | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
jobs: | ||
create-and-push-image: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: "Create and push the Docker image to GAR" | ||
placeholder-job: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: 'setup-qemu' | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- id: 'docker-buildx-setup' | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- id: 'auth' | ||
name: 'Authenticate to Google Cloud' | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
create_credentials_file: true | ||
token_format: access_token | ||
workload_identity_provider: 'projects/1006240973223/locations/global/workloadIdentityPools/deploy-backstage/providers/github-actions' | ||
service_account: '[email protected]' | ||
- id: 'login-gar' | ||
name: "Login to GAR" | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: europe-west10-docker.pkg.dev/code-idp/backstage-deploy | ||
username: oauth2accesstoken | ||
password: ${{ steps.auth.outputs.access_token }} | ||
- id: 'build-and-push' | ||
name: 'Build and Push docker Image' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
tags: europe-west10-docker.pkg.dev/code-idp/backstage-deploy/backstage-image:${{ github.sha }} | ||
build-args: | | ||
APP_ENV=docker | ||
deploy-image: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: "Deploy image on cloud run" | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
needs: create-and-push-image | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: 'auth' | ||
name: 'Authenticate to Google Cloud' | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
create_credentials_file: true | ||
workload_identity_provider: 'projects/1006240973223/locations/global/workloadIdentityPools/deploy-backstage/providers/github-actions' | ||
service_account: '[email protected]' | ||
- id: 'deploy' | ||
uses: 'google-github-actions/deploy-cloudrun@v2' | ||
with: | ||
service: 'backstage-deployment' | ||
image: 'europe-west10-docker.pkg.dev/code-idp/backstage-deploy/backstage-image:${{ github.sha }}' | ||
region: europe-west1 | ||
flags: '--port=7007 --add-cloudsql-instances=code-idp:europe-west10:backstage-pg' | ||
env_vars: | | ||
POSTGRES_HOST=/cloudsql/code-idp:europe-west10:backstage-pg | ||
POSTGRES_PORT=5432 | ||
POSTGRES_USER=postgres | ||
BASE_URL=https://backstage.foundations-software-engineering.com | ||
secrets: |- | ||
POSTGRES_PASSWORD=postgres-password:latest | ||
GITHUB_TOKEN=github_token:latest | ||
GOOGLE_CLIENT_ID=google_client_id:latest | ||
GOOGLE_CLIENT_SECRET=google_client_secret:latest | ||
- name: hello world | ||
run: echo "Hello World" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Only difference here is that we need a caFile if it is deployed inside of a kube cluster | ||
kubernetes: | ||
serviceLocatorMethod: | ||
type: multiTenant | ||
clusterLocatorMethods: | ||
- type: config | ||
clusters: | ||
- url: ${K8S_URL} | ||
name: "k8s" | ||
authProvider: serviceAccount | ||
skipTLSVerify: false | ||
skipMetricsLookup: true | ||
serviceAccountToken: ${K8S_ACCOUNT_TOKEN} | ||
caData: ${K8S_CA_DATA} | ||
caFile: ${K8S_CA_FILE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# kubernetes/backstage.yaml | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: backstage | ||
namespace: backstage | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: backstage | ||
template: | ||
metadata: | ||
labels: | ||
app: backstage | ||
spec: | ||
# serviceAccountName: staging-rem-backend-service-acc | ||
containers: | ||
- name: backstage | ||
image: notemann27/backstage:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- name: http | ||
containerPort: 7007 | ||
envFrom: | ||
- secretRef: | ||
name: backstage-secrets | ||
# Uncomment if health checks are enabled in your app: | ||
# https://backstage.io/docs/plugins/observability#health-checks | ||
# readinessProbe: | ||
# httpGet: | ||
# port: 7007 | ||
# path: /healthcheck | ||
# livenessProbe: | ||
# httpGet: | ||
# port: 7007 | ||
# path: /healthcheck |
Oops, something went wrong.