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

Adding new CI Pipelines to deploy to giveth-all stacks #21

Merged
merged 10 commits into from
Dec 26, 2023
56 changes: 0 additions & 56 deletions .github/workflows/CI-CD.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/main-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ci-main

on:
pull_request:
types: [closed]
branches:
- main
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/giveth/giveconomy-notification-service:main

deploy:
if: github.event.pull_request.merged == true
needs: publish
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.PROD_HOST_ALL }}
username: ${{ secrets.PROD_USERNAME_ALL }}
key: ${{ secrets.PROD_PRIVATE_KEY_ALL }}
port: ${{ secrets.SSH_PORT }}
script: |
cd giveth-all
docker-compose stop givEconomy-notification-service
docker-compose pull givEconomy-notification-service
docker-compose up -d givEconomy-notification-service
docker image prune -a --force
49 changes: 49 additions & 0 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: ci-staging

on:
pull_request:
types: [closed]
branches:
- staging
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/giveth/giveconomy-notification-service:staging

deploy:
needs: publish
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.STAGING_HOST_ALL }}
username: ${{ secrets.STAGING_USERNAME_ALL }}
key: ${{ secrets.STAGING_PRIVATE_KEY_ALL }}
port: ${{ secrets.SSH_PORT }}
script: |
cd giveth-all
docker-compose stop givEconomy-notification-service
docker-compose pull givEconomy-notification-service
docker-compose up -d givEconomy-notification-service
docker image prune -a --force
6 changes: 6 additions & 0 deletions monitorConfig/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export const config: Config = {
pollTimeMS: Number(process.env.OPTIMISM_POLL_TIME) || 30_000, // 30 Seconds
maxFetchBlockRange: 1_000,
contracts: [
{
address: '0x301C739CF6bfb6B47A74878BdEB13f92F13Ae5E7',
title: 'Optimism GIVPower',
startBlock: 108350094,
type: ContractType.GIVpower,
},
{
address: '0xE3Ac7b3e6B4065f4765d76fDC215606483BF3bD1',
title: 'Optimism Token Distro',
Expand Down