Skip to content
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

Github Actions implementation #51

Merged
merged 83 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
1ec09ac
add all changes
Sep 26, 2023
800ff8e
fix
Sep 26, 2023
75e6a15
add file.json
Sep 26, 2023
4e0c9e7
Merge branch 'develop' of https://dev.azure.com/Kryha-io/Agoric/_git/…
Sep 26, 2023
9a77b85
Merge branch 'develop' of https://dev.azure.com/Kryha-io/Agoric/_git/…
Sep 26, 2023
27c19f5
add kustomization.yaml
Sep 26, 2023
3f04d51
emerynet on constants
Sep 27, 2023
2315868
remove non-needed stuff for emerynet
Sep 27, 2023
5f842eb
Merge branch 'develop' of https://dev.azure.com/Kryha-io/Agoric/_git/…
Sep 27, 2023
037ea89
update
Sep 27, 2023
6f5a972
hotfix url
WietzeSlagman Sep 27, 2023
7dcd0ba
Merge branch 'hotfix/emerynet-connection' into pbi/emerynet-frontend
WietzeSlagman Sep 27, 2023
b0c5d19
fix merge conflicts
Sep 27, 2023
b6f0952
quickfix
carlos-kryha Sep 27, 2023
5d02cf8
Merge remote-tracking branch 'origin/develop' into pbi/emerynet-frontend
WietzeSlagman Sep 27, 2023
21884c6
Add network config logic. Default to localhost if no arg supplied
Sep 28, 2023
dd87980
Fix naming convention Devnet -> Emerynet
Sep 28, 2023
47dc779
revert new logic
Sep 28, 2023
6d60a15
implement revised logic
Sep 28, 2023
68ad595
Revert "implement revised logic"
Sep 28, 2023
a5a44d5
Add dockerfile and skaffold template changes
Sep 28, 2023
fc2ab06
NETWORK_CONFIG to VITE_NETWORK_CONFIG
Sep 28, 2023
d2a4b60
fix merge conflict constants.ts
Sep 29, 2023
b8adbb9
Updated constants.ts
xabierkryha Sep 29, 2023
1ae144a
Update agoric.tsx with develop content
xabierkryha Sep 29, 2023
99acc78
Updated azure-pipelines-prod.yml
xabierkryha Sep 29, 2023
58ca9b8
fix docker url
Sep 29, 2023
3e02c4a
fix skaffold config for prod
Sep 29, 2023
bd144c0
Merge branch 'develop' of https://dev.azure.com/Kryha-io/Agoric/_git/…
Sep 29, 2023
32806ec
Merge remote-tracking branch 'origin/develop' into pbi/emerynet-frontend
WietzeSlagman Sep 29, 2023
98a3215
Merge remote-tracking branch 'origin/develop' into pbi/emerynet-frontend
WietzeSlagman Oct 1, 2023
8148423
Merge remote-tracking branch 'origin/develop' into pbi/emerynet-frontend
WietzeSlagman Oct 1, 2023
f42339c
use gke
WietzeSlagman Oct 1, 2023
36a4e8d
use gcr
WietzeSlagman Oct 1, 2023
9b29ab3
update to gcr
WietzeSlagman Oct 1, 2023
7f4ecae
fix
WietzeSlagman Oct 1, 2023
c269b69
Merged PR 4476: Merged PR 4475: Provision error and no chars in marke…
xabierkryha Oct 2, 2023
d64fd19
Merged PR 4477: merge dev into emerynet-frontend
xabierkryha Oct 2, 2023
db6f0b6
Merged PR 4483: add develop changes
xabierkryha Oct 3, 2023
890767f
Merged PR 4486: merge dev changes
xabierkryha Oct 4, 2023
ed91e76
Merge remote-tracking branch 'origin/develop' into pbi/emerynet-frontend
WietzeSlagman Oct 4, 2023
953c843
Azure pipelines -> gh actions for Emerynet
Oct 11, 2023
21383fa
changes for emerynet pipelien
Oct 11, 2023
8d3788a
modify registry
Oct 11, 2023
fab0b97
Update
Oct 11, 2023
bf838d6
rename workflow
Oct 11, 2023
5ce94ee
update
Oct 11, 2023
f86d245
push updates
Oct 11, 2023
29c2598
update
Oct 11, 2023
87141bf
update
Oct 11, 2023
651bfd9
update
Oct 11, 2023
e772e90
update
Oct 11, 2023
59f6778
update
Oct 11, 2023
c0c3ba6
update
Oct 11, 2023
1a9a964
update
Oct 11, 2023
0e25716
update
Oct 11, 2023
3707864
update
Oct 11, 2023
987eb38
update
Oct 11, 2023
b6f552a
Update
Oct 11, 2023
2e732a1
fi
Oct 11, 2023
a7d402b
fix
Oct 11, 2023
7515638
fix login
Oct 11, 2023
ce869fd
update
Oct 11, 2023
5492f93
trigger again
Oct 11, 2023
4079e8d
fix content for emerynet
Oct 11, 2023
8a1f4be
update
Oct 11, 2023
cb9121e
fix
Oct 11, 2023
df780fc
update
Oct 11, 2023
dde1694
update
Oct 11, 2023
6c7c0d7
update
Oct 11, 2023
f524224
dd workflow dispatch
Oct 11, 2023
5adf2bc
update
Oct 11, 2023
75b5082
add mainnet pipeline
Oct 11, 2023
2b61639
Add codeowners
Oct 11, 2023
4aee6bd
Update kread-emerynet-cicd.yml task name
snthtcs Oct 11, 2023
1222415
Update kread-mainnet-cicd.yml add new secrets
snthtcs Oct 11, 2023
480cc8d
Update kread-emerynet-cicd.yml add new secrets
snthtcs Oct 11, 2023
efab6ec
Update kread-emerynet-cicd.yml service account param
snthtcs Oct 11, 2023
0e46ad7
Update kread-mainnet-cicd.yml add sa param
snthtcs Oct 11, 2023
bc4b751
test changes
snthtcs Oct 11, 2023
944f9a4
Update kread-emerynet-cicd.yml
snthtcs Oct 11, 2023
b3a157e
Update kread-mainnet-cicd.yml
snthtcs Oct 11, 2023
64126c6
Update items-shop.tsx with develop content
snthtcs Oct 12, 2023
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
58 changes: 58 additions & 0 deletions .github/workflows/kread-emerynet-cicd.yml
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

58 changes: 58 additions & 0 deletions .github/workflows/kread-mainnet-cicd.yml
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

2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @WietzeSlagman
* @carlos-kryha
38 changes: 0 additions & 38 deletions azure-pipelines-prod.yml

This file was deleted.

58 changes: 0 additions & 58 deletions azure-pipelines.old.yml

This file was deleted.

38 changes: 0 additions & 38 deletions azure-pipelines.yml

This file was deleted.

13 changes: 13 additions & 0 deletions deployment/emerynet/workloads/config/ui-config.template.yaml
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"
23 changes: 23 additions & 0 deletions deployment/emerynet/workloads/ingresses/ui.yaml
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
7 changes: 7 additions & 0 deletions deployment/emerynet/workloads/kustomization.yaml
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
7 changes: 7 additions & 0 deletions deployment/emerynet/workloads/namespace/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: agoric-makefile-automation


Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ spec:
spec:
containers:
- name: ui
image: "$DOCKER_REPO:latest"
image: "eu.gcr.io/web3-335312/kread/frontend-production/frontend:latest"
29 changes: 23 additions & 6 deletions frontend/Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM node:16-alpine as build
FROM node:18-alpine as build

RUN apk --no-cache add --update git python3 make g++

WORKDIR /usr/main/

RUN yarn set version 2 --only-if-needed

ENV GENERATE_SOURCEMAP false
ENV GENERATE_SOURCEMAP true

ARG VITE_DAPP_CONSTANTS_JSON
ENV VITE_DAPP_CONSTANTS_JSON $VITE_DAPP_CONSTANTS_JSON
ARG VITE_RPC
ENV VITE_RPC $VITE_RPC

ARG VITE_BRIDE_HREF
ENV VITE_BRIDE_HREF $VITE_BRIDE_HREF

ARG VITE_BASE_URL
ENV VITE_BASE_URL $VITE_BASE_URL

ARG PINATA_GATEWAY
ENV PINATA_GATEWAY $PINATA_GATEWAY

ARG VITE_NETWORK_CONFIG
ENV VITE_NETWORK_CONFIG $VITE_NETWORK_CONFIG

COPY .yarnrc.yml ./.yarnrc.yml
COPY yarn.lock ./yarn.lock
Expand All @@ -18,9 +30,14 @@ COPY .yarn/ ./.yarn/
COPY .eslintrc.json ./.eslintrc.json
COPY .eslintignore ./.eslintignore

COPY index.html ./index.html

COPY package.json ./package.json

COPY tsconfig.json ./tsconfig.json
COPY config-overrides.js ./config-overrides.js
COPY tsconfig.node.json ./tsconfig.node.json

COPY vite.config.ts ./vite.config.ts

COPY public/ ./public/
COPY src/ ./src/
Expand All @@ -33,7 +50,7 @@ FROM nginx:1.21-alpine as run

RUN sed -i '/location \//a try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf

COPY --from=build /usr/main/build/ /usr/share/nginx/html/
COPY --from=build /usr/main/dist/ /usr/share/nginx/html/

EXPOSE 80

Expand Down
Loading