Skip to content

Merge pull request #640 from C-Otto/patch-1 #505

Merge pull request #640 from C-Otto/patch-1

Merge pull request #640 from C-Otto/patch-1 #505

Workflow file for this run

name: Build & Deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
VUE_APP_IP_API_KEY: ${{ vars.VUE_APP_IP_API_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Yarn Install
run: yarn install
- name: ENV_VARS
run: echo "VUE_APP_IP_API_KEY=$VUE_APP_IP_API_KEY" >> .env
- 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:push
- name: Pull new image and restart
uses: appleboy/[email protected]
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