Skip to content

Commit

Permalink
server: Initial auto-deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jan 10, 2021
1 parent 973f15f commit 9a35d6f
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Build Dockerfile.server
run: |
docker build . -t evanpurkhiser/prolink-tools-server -f conf/Dockerfile.server
- name: Publish
run: |
docker login --username=evanpurkhiser --password-stdin <<< "${{ secrets.DOCKER_HUB_TOKEN }}"
docker push evanpurkhiser/prolink-tools-server:latest
- name: Setup ssh-agent
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.DIGITAL_OCEAN_PRIVATE_KEY }}

- name: Add known hosts for app.prolink.tools
run: ssh-keyscan -H app.prolink.tools > ~/.ssh/known_hosts

- name: Copy server-compose file
run: |
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ./conf/server-compose.yml root@app.prolink.tools:./
- name: Update images
uses: appleboy/ssh-action@master
with:
host: app.prolink.tools
script: |
whoami
ls -al
46 changes: 46 additions & 0 deletions conf/server-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '2'

services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
environment:
- "DEFAULT_EMAIL=evanpurkhiser@gmail.com"
ports:
- "80:80"
- "443:443"
volumes:
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- dhparam:/etc/nginx/dhparam
- certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
network_mode: bridge

letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-proxy-le
volumes_from:
- nginx-proxy
volumes:
- certs:/etc/nginx/certs:rw
- acme:/etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
network_mode: bridge

prolink-tools:
image: evanpurkhiser/prolink-tools-server
container_name: prolink-tools
environment:
- "VIRTUAL_HOST=app.prolink.tools"
- "LETSENCRYPT_HOST=app.prolink.tools"
network_mode: bridge

volumes:
conf:
vhost:
html:
dhparam:
certs:
acme:

1 comment on commit 9a35d6f

@vercel
Copy link

@vercel vercel bot commented on 9a35d6f Jan 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.