Skip to content
Open
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
75 changes: 39 additions & 36 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
types:
- released
- prereleased
push:
branches:
- ch-change-deployment

jobs:
build:
Expand All @@ -14,37 +17,31 @@ jobs:
tag: ${{ steps.export.outputs.tag }}

runs-on: ubuntu-latest
env:
image: cranecloud/activity-logger

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main # Reference branch
# with:
# ref: main # Reference branch

- name: Install (Buildx)
uses: docker/setup-buildx-action@v3

- name: Login (GCP)
uses: google-github-actions/auth@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v1
with:
project_id: crane-cloud-274413
install_components: "gke-gcloud-auth-plugin"

- name: Login (GCR)
run: gcloud auth configure-docker
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- id: meta
name: Tag
uses: docker/metadata-action@v3
with:
flavor: |
latest=true
images: gcr.io/crane-cloud-274413/activity-logger
images: ${{ env.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -53,19 +50,18 @@ jobs:
type=sha

- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: Dockerfile
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}

- id: export
name: Export
uses: actions/github-script@v5
uses: actions/github-script@v7
with:
script: |
const metadata = JSON.parse(`${{ steps.meta.outputs.json }}`)
Expand All @@ -88,28 +84,35 @@ jobs:

env:
namespace: cranecloud-prod
image: cranecloud/activity-logger

steps:
- name: Clone
uses: actions/checkout@v2

- name: Login (GCP)
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v1
with:
project_id: crane-cloud-274413
install_components: "gke-gcloud-auth-plugin"
- name: Checkout code
uses: actions/checkout@v4

- name: Login (Kubernetes Cluster)
uses: google-github-actions/get-gke-credentials@v1
# --- GCP DEPLOYEMENT ---
# - name: Login (GCP)
# uses: google-github-actions/auth@v2
# with:
# credentials_json: ${{ secrets.CREDENTIALS_JSON }}

# - name: Install (Gcloud)
# uses: google-github-actions/setup-gcloud@v2
# with:
# project_id: crane-cloud-274413
# install_components: "gke-gcloud-auth-plugin"

# - name: Login (Kubernetes Cluster)
# uses: google-github-actions/get-gke-credentials@v2
# with:
# cluster_name: staging-cluster
# location: us-central1-a
# project_id: crane-cloud-274413

# --- RENU DEPLOYEMENT ---
- uses: azure/k8s-set-context@v1
with:
cluster_name: staging-cluster
location: us-central1-a
project_id: crane-cloud-274413
kubeconfig: ${{ secrets.RENU_KUBECONFIG}}

- name: Add Repo (cranecloud)
run: |
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,29 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Login (GCP)
uses: google-github-actions/auth@v2
# --- GCP DEPLOYEMENT ---
# - name: Login (GCP)
# uses: google-github-actions/auth@v2
# with:
# credentials_json: ${{ secrets.CREDENTIALS_JSON }}

# - name: Install (Gcloud)
# uses: google-github-actions/setup-gcloud@v2
# with:
# project_id: crane-cloud-274413
# install_components: "gke-gcloud-auth-plugin"

# - name: Login (Kubernetes Cluster)
# uses: google-github-actions/get-gke-credentials@v2
# with:
# cluster_name: staging-cluster
# location: us-central1-a
# project_id: crane-cloud-274413

# --- RENU DEPLOYEMENT ---
- uses: azure/k8s-set-context@v1
with:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v2
with:
project_id: crane-cloud-274413
install_components: "gke-gcloud-auth-plugin"

- name: Login (Kubernetes Cluster)
uses: google-github-actions/get-gke-credentials@v2
with:
cluster_name: staging-cluster
location: us-central1-a
project_id: crane-cloud-274413
kubeconfig: ${{ secrets.RENU_KUBECONFIG}}

- name: Add Repo (cranecloud)
run: |
Expand Down
4 changes: 2 additions & 2 deletions helm/values.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 1

image:
repository: gcr.io/crane-cloud-274413/activity-logger
repository: cranecloud/activity-logger
pullPolicy: Always
tag: ${{ DOCKER_IMAGE_TAG }}

Expand Down Expand Up @@ -42,7 +42,7 @@ celery:
port: 5001

redis:
create: false
create: true

mongo:
create: true
Loading