Skip to content

Commit

Permalink
fix(update): updated dependecies
Browse files Browse the repository at this point in the history
  • Loading branch information
lanathlor committed Apr 18, 2021
1 parent 25d66c4 commit 2e885b6
Show file tree
Hide file tree
Showing 5 changed files with 729 additions and 9,399 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: DigitalOcean Deployment

env:
REGISTRY: "registry.digitalocean.com/authapi"
IMAGE_NAME: "dosismart-bridge"

on:
push:
branches: [ master ]

jobs:
build_and_push:
runs-on: ubuntu-latest

steps:
- name: Checkout master
uses: actions/checkout@v2

- name: Build container image
run: docker build -t $(echo $REGISTRY)/$(echo $IMAGE_NAME):$(echo $GITHUB_SHA | head -c7) .

- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 600

- name: Push image to DigitalOcean Container Registry
run: docker push $(echo $REGISTRY)/$(echo $IMAGE_NAME):$(echo $GITHUB_SHA | head -c7)

deploy:
runs-on: ubuntu-latest
needs: build_and_push

steps:
- name: Deploy to Digital Ocean droplet via SSH action
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
envs: IMAGE_NAME,REGISTRY,GITHUB_SHA,COMMAND
script: |
# Stop running container
docker stop $(echo $IMAGE_NAME)
# Remove old container
docker rm $(echo $IMAGE_NAME)
# Run a new container from a new image
docker run -d \
--restart always \
--env-file env \
-p 8080:9090 \
--name $(echo $IMAGE_NAME) \
$(echo $REGISTRY)/$(echo $IMAGE_NAME):$(echo $GITHUB_SHA | head -c7) $(echo $COMMAND)
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
Logs
dist
build
.env*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.15.0
Loading

0 comments on commit 2e885b6

Please sign in to comment.