Sandwich
2 years ago
committed by
GitHub
8 changed files with 91 additions and 12 deletions
@ -0,0 +1,40 @@ |
|||||
|
name: Build & Deploy |
||||
|
on: |
||||
|
push: |
||||
|
branches: [main] |
||||
|
|
||||
|
jobs: |
||||
|
deploy: |
||||
|
runs-on: ubuntu-latest |
||||
|
steps: |
||||
|
|
||||
|
- name: Checkout |
||||
|
uses: actions/checkout@v2 |
||||
|
|
||||
|
- name: Yarn Install |
||||
|
run: yarn install |
||||
|
|
||||
|
- name: Docker Build & tag |
||||
|
run: | |
||||
|
yarn docker:build |
||||
|
yarn docker:tag |
||||
|
|
||||
|
- name: Configure doctl |
||||
|
uses: digitalocean/action-doctl@v2 |
||||
|
with: |
||||
|
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
||||
|
|
||||
|
- name: Login to doctl registry |
||||
|
run: doctl registry login -t ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
||||
|
|
||||
|
- name: Docker Deploy |
||||
|
run: | |
||||
|
yarn docker:deploy |
||||
|
|
||||
|
- name: Pull new image and restart |
||||
|
uses: appleboy/ssh-action@v0.1.2 |
||||
|
with: |
||||
|
host: ${{secrets.SSH_DEPLOY_HOST}} |
||||
|
key: ${{secrets.SSH_DEPLOY_KEY}} |
||||
|
username: ${{ secrets.SSH_DEPLOY_USERNAME }} |
||||
|
script: docker pull registry.digitalocean.com/sandwich-farm/nostr-relay-status:latest && docker-compose stop && docker-compose up -d |
@ -0,0 +1,21 @@ |
|||||
|
name: Test Relay |
||||
|
on: |
||||
|
pull_request: |
||||
|
paths: |
||||
|
- 'relays.yaml' |
||||
|
|
||||
|
jobs: |
||||
|
check_relay: |
||||
|
name: Check |
||||
|
runs-on: ubuntu-latest |
||||
|
steps: |
||||
|
- uses: actions/checkout@v2 |
||||
|
- uses: technote-space/get-diff-action@v6 |
||||
|
with: |
||||
|
PATTERNS: | |
||||
|
+(src|__tests__)/**/*.ts |
||||
|
!src/exclude.ts |
||||
|
FILES: | |
||||
|
relays.yml |
||||
|
- name: Check differences |
||||
|
run: echo ${{ env.GIT_DIFF }} |
Loading…
Reference in new issue