-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Giveth/staging
Adding new CI Pipelines to deploy to giveth-all stacks
- Loading branch information
Showing
4 changed files
with
105 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,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 |
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,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 |
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