Skip to content

Commit

Permalink
Merge pull request #21 from Giveth/staging
Browse files Browse the repository at this point in the history
Adding new CI Pipelines to deploy to giveth-all stacks
  • Loading branch information
mhmdksh authored Dec 26, 2023
2 parents 918af3c + c9b8a9c commit 59178cb
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 56 deletions.
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

0 comments on commit 59178cb

Please sign in to comment.