adds docker deployment
This commit is contained in:
28
.github/workflows/deploy-pipeline.yml
vendored
28
.github/workflows/deploy-pipeline.yml
vendored
@@ -1,28 +0,0 @@
|
||||
name: Deploy Pipeline
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- run: sed -i -e "s~@database-uri~$DATABASE_URI~g" app.yaml
|
||||
env:
|
||||
DATABASE_URI: ${{secrets.DATABASE_URI}}
|
||||
|
||||
- run: sed -i -e "s~@mongodb-uri~$MONGODB_URI~g" app.yaml
|
||||
env:
|
||||
MONGODB_URI: ${{secrets.MONGODB_URI}}
|
||||
|
||||
- uses: actions-hub/gcloud@master
|
||||
env:
|
||||
PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
|
||||
APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
|
||||
with:
|
||||
args: app -q deploy app.yaml --promote
|
||||
42
.github/workflows/deploy.yml
vendored
Normal file
42
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Create Docker image
|
||||
run: |
|
||||
docker build -t torrentio-addon:latest ./addon/
|
||||
docker save torrentio-addon:latest > torrentio_addon_latest.tar
|
||||
|
||||
- name: Upload Docker image
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USERNAME }}
|
||||
port: ${{ secrets.SSH_PORT }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
source: torrentio_addon_latest.tar
|
||||
target: /tmp/docker
|
||||
overwrite: true
|
||||
|
||||
- name: Deploy Docker image
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USERNAME }}
|
||||
port: ${{ secrets.SSH_PORT }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
script: |
|
||||
docker load -i /tmp/docker/torrentio_addon_latest.tar
|
||||
docker stop torrentio-addon
|
||||
docker rm torrentio-addon
|
||||
docker run -p 80:7000 -d --name torrentio-addon --restart always -e MONGODB_URI=${{ secrets.MONGODB_URI }} -e DATABASE_URI=${{ secrets.DATABASE_URI }} -e RESOLVER_HOST=${{ secrets.RESOLVER_HOST }} torrentio-addon:latest
|
||||
docker image prune -f
|
||||
Reference in New Issue
Block a user