Skip to content

Commit

Permalink
Merge pull request #48 from edenia/update-ci-pipeline
Browse files Browse the repository at this point in the history
Update ci/cd pipeline
  • Loading branch information
fagomezra committed Jul 21, 2023
2 parents 9139487 + 2d3b0ae commit b79ceab
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 42 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/push-dev-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,28 @@ on:
- main

jobs:
create-dev-image:
publish:
name: build and deploy
runs-on: ubuntu-latest
environment: development

steps:
- name: Checkout Repo
uses: actions/[email protected]

- name: Setup Docker
uses: docker-practice/[email protected]
uses: actions/checkout@v3

- name: Log in to docker registry
run: |
echo ${{ secrets.DOCKER_PASSWORD}} | docker login \
--username ${{ secrets.DOCKER_USERNAME }} \
--password-stdin
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build new images and push
run: |
make \
build-docker-images \
push-docker-images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# webapp
PORT: 80
REACT_APP_TAG: ${{ github.ref }}
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/push-prod-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,28 @@ on:
- v*

jobs:
create-prod-image:
publish:
name: build and deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout Repo
uses: actions/[email protected]

- name: Setup Docker
uses: docker-practice/[email protected]
uses: actions/checkout@v3

- name: Log in to docker registry
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login \
--username ${{ secrets.DOCKER_USERNAME }} \
--password-stdin
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build new images and push
run: |
make \
build-docker-images \
push-docker-images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# webapp
PORT: 80
REACT_APP_TAG: ${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
name: webapp
port: 80
tls:
secretName: tls-secret
certResolver: myresolver
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
Expand Down Expand Up @@ -60,4 +60,4 @@ spec:
name: hasura
port: 8080
tls:
secretName: tls-secret
certResolver: myresolver
9 changes: 0 additions & 9 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ build-kubernetes: ./kubernetes
deploy-kubernetes: ##@devops Publish the build k8s files
deploy-kubernetes: $(K8S_BUILD_DIR)
@kubectl create ns $(NAMESPACE) || echo "Namespace '$(NAMESPACE)' already exists.";
@echo "Creating SSL certificates..."
@kubectl create secret tls \
tls-secret \
--key ./ssl/edenia.cloud.priv.key \
--cert ./ssl/edenia.cloud.crt \
-n $(NAMESPACE) || echo "SSL cert already configured.";
@echo "Creating configmaps..."
@kubectl create configmap -n $(NAMESPACE) \
wallet-config \
Expand All @@ -110,9 +104,6 @@ build-docker-images:

push-docker-images: ##@devops Publish docker images
push-docker-images:
@echo $(DOCKER_PASSWORD) | docker login \
--username $(DOCKER_USERNAME) \
--password-stdin
for dir in $(SUBDIRS); do \
$(MAKE) push-image -C $$dir; \
done
3 changes: 2 additions & 1 deletion utils/meta.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ IMAGE_NAME_HAPI=hapi
IMAGE_NAME_HASURA=hasura
IMAGE_NAME_WALLET=wallet

DOCKER_REGISTRY=eoscostarica506
IMAGE_ID=$(shell docker images --format '{{.ID}}' --filter reference='docker.pkg.github.com/edenia/edenia.com*latest')
DOCKER_REGISTRY=ghcr.io/edenia/boilerplate
SUBDIRS = webapp hapi hasura wallet

MAKE_ENV += DOCKER_REGISTRY VERSION IMAGE_NAME_WEBAPP IMAGE_NAME_HAPI IMAGE_NAME_WALLET IMAGE_NAME_HASURA
Expand Down
13 changes: 7 additions & 6 deletions wallet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM ubuntu:18.04 as install-stage
FROM ubuntu:22.04 as install-stage

ENV WORK_DIR /opt/application
ENV EOSIO_PACKAGE_URL https://github.com/EOSIO/eos/releases/download/v2.1.0/eosio_2.1.0-1-ubuntu-18.04_amd64.deb
ENV EOSIO_PACKAGE_URL https://github.com/AntelopeIO/leap/releases/download/v4.0.4/leap_4.0.4-ubuntu20.04_amd64.deb


# Install wget
RUN apt-get update && apt-get install -y wget

# Install EOSIO
RUN wget -O eosio.deb $EOSIO_PACKAGE_URL
RUN apt-get install -y /eosio.deb
# Install Antelope
RUN wget -O antelope.deb $EOSIO_PACKAGE_URL
RUN apt-get install -y /antelope.deb

# Remove all of the unnecesary files and apt cache
RUN rm ./eosio.deb \
RUN rm ./antelope.deb \
&& apt-get remove -y wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit b79ceab

Please sign in to comment.