-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR introduces GitHub Actions pipelines into the Kread Frontend repository's workflow, enabling automated deployment to both the Emerynet and Mainnet environments. - PR -> develop (requires approver) -> Deploys to Emerynet on PR closed - develop -> PR -> main (requires approver from CODEOWNERS) -> Deploys to Mainnet on PR closed CODEOWNERS: - @carlos-kryha - @WietzeSlagman --------- Co-authored-by: Xabier Almazor <[email protected]> Co-authored-by: Xabier Almazor <[email protected]> Co-authored-by: Wietze <[email protected]> Co-authored-by: CARLOS TRIGO <[email protected]> Co-authored-by: Xabier Almazor Telek <[email protected]>
- Loading branch information
1 parent
cacaf78
commit 00aa0e2
Showing
15 changed files
with
229 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: CI/CD Emerynet | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: | ||
- closed | ||
|
||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Skaffold | ||
run: | | ||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 | ||
sudo install skaffold /usr/local/bin/ | ||
shell: bash | ||
|
||
- name: Authenticate with Google Cloud | ||
uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
service_account_key: ${{ secrets.GCP_AUTH_KEY }} | ||
project_id: ${{ secrets.PROJECT_ID }} | ||
export_default_credentials: true | ||
|
||
- name: Activate Service Account | ||
run: | | ||
gcloud auth activate-service-account ${{ secrets.GCP_SA }} --key-file=$GOOGLE_APPLICATION_CREDENTIALS | ||
gcloud components install gke-gcloud-auth-plugin | ||
- name: Login to GCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: eu.gcr.io | ||
username: _json_key | ||
password: ${{ secrets.GCP_AUTH_KEY }} | ||
|
||
- name: Login to Kubernetes | ||
uses: azure/k8s-set-context@v1 | ||
with: | ||
kubeconfig: ${{ secrets.KUBECONFIG }} | ||
cluster-context: ${{ secrets.CLUSTER_CONTEXT }} | ||
namespace: ${{ secrets.K8S_NAMESPACE_EMERYNET }} | ||
|
||
- name: Build and push Docker images | ||
run: | | ||
cd frontend | ||
export $(grep -v '^#' .env.emerynet | xargs) | ||
envsubst < ../deployment/emerynet/workloads/config/ui-config.template.yaml > ../deployment/emerynet/workloads/config/ui-config.yaml | ||
envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml | ||
skaffold run --filename skaffold.emerynet.yaml | ||
shell: bash | ||
|
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,58 @@ | ||
name: CI/CD Mainnet | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Skaffold | ||
run: | | ||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 | ||
sudo install skaffold /usr/local/bin/ | ||
shell: bash | ||
|
||
- name: Authenticate with Google Cloud | ||
uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
service_account_key: ${{ secrets.GCP_AUTH_KEY }} | ||
project_id: ${{ secrets.PROJECT_ID }} | ||
export_default_credentials: true | ||
|
||
- name: Activate Service Account | ||
run: | | ||
gcloud auth activate-service-account ${{ secrets.GCP_SA }} --key-file=$GOOGLE_APPLICATION_CREDENTIALS | ||
gcloud components install gke-gcloud-auth-plugin | ||
- name: Login to GCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: eu.gcr.io | ||
username: _json_key | ||
password: ${{ secrets.GCP_AUTH_KEY }} | ||
|
||
- name: Login to Kubernetes | ||
uses: azure/k8s-set-context@v1 | ||
with: | ||
kubeconfig: ${{ secrets.KUBECONFIG }} | ||
cluster-context: ${{ secrets.CLUSTER_CONTEXT }} | ||
namespace: ${{ secrets.K8S_NAMESPACE_MAINNET }} | ||
|
||
- name: Build and push Docker images | ||
run: | | ||
cd frontend | ||
export $(grep -v '^#' .env.mainnet | xargs) | ||
envsubst < ../deployment/mainnet/workloads/config/ui-config.template.yaml > ../deployment/mainnet/workloads/config/ui-config.yaml | ||
envsubst < skaffold.mainnet.template.yaml > skaffold.mainnet.yaml | ||
skaffold run --filename skaffold.mainnet.yaml | ||
shell: bash | ||
|
Validating CODEOWNERS rules …
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,2 @@ | ||
* @WietzeSlagman | ||
* @carlos-kryha |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
deployment/emerynet/workloads/config/ui-config.template.yaml
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,13 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: ui | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: ui | ||
template: | ||
spec: | ||
containers: | ||
- name: ui | ||
image: "eu.gcr.io/web3-335312/kread/frontend-staging/frontend:latest" |
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,23 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ui-devnet | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
cert-manager.io/cluster-issuer: "letsencrypt-staging" | ||
nginx.ingress.kubernetes.io/rewrite-target: /$1 | ||
nginx.ingress.kubernetes.io/proxy-body-size: 200m | ||
spec: | ||
ports: | ||
- name: 80-tcp | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
- name: 443-tcp | ||
port: 443 | ||
protocol: TCP | ||
targetPort: 443 | ||
selector: | ||
app: ui | ||
sessionAffinity: None | ||
type: ClusterIP |
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,7 @@ | ||
bases: | ||
- ../../base | ||
resources: | ||
- namespace/namespace.yaml | ||
patchesStrategicMerge: | ||
- config/ui-config.yaml | ||
namespace: agoric-makefile-automation |
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,7 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: agoric-makefile-automation | ||
|
||
|
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
Oops, something went wrong.