-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
22 deletions.
There are no files selected for viewing
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,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 |
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,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 |
This file was deleted.
Oops, something went wrong.