Skip to content

Commit

Permalink
gateway-production
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadmitt committed Mar 12, 2024
1 parent 38c1182 commit 8eb12e6
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 22 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/production_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Staging Backend
on:
push:
branches: [gateway-production]

jobs:
build-staging-backend:
name: Service deployment
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkount
uses: actions/checkout@v2

- name: Setup node and npm
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Login to container registry
uses: docker/login-action@v2
with:
registry: ${{secrets.CONTANER_REGISTRY_URL}}
username: ${{secrets.CONTAINER_REGISTRY_KEY}}
password: ${{secrets.CONTAINER_REGISTRY_KEY}}

- name: Build backend app
run: |
yarn install
yarn run build
- name: Build image and push to container registry
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{secrets.CONTANER_REGISTRY_URL}}/namespace/offchain-gateway-prod:latest
26 changes: 26 additions & 0 deletions .github/workflows/production_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy offchain subnames api
on:
workflow_dispatch:
inputs:
version:
description: restart
default: v1.0.0
required: true

jobs:
restart-offchain-subnames-api:
name: Restart offchain subnames api
runs-on: ubuntu-latest

steps:
- name: Perform restart
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_URL_PROD }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_KEY }}
script: |
docker stop offchain-gateway
docker rm offchain-gateway
docker image pull registry.digitalocean.com/namespace/offchain-gateway-prod:latest
docker run -d -p 80:3000 --env-file prod.env --name offchain-gateway registry.digitalocean.com/namespace/offchain-gateway-prod:latest
22 changes: 0 additions & 22 deletions .github/workflows/staging_deploy.yaml

This file was deleted.

0 comments on commit 8eb12e6

Please sign in to comment.