diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index eb5c01b..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Deploy - -on: - push: - branches: master - paths: - - 'addon/**' - -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 }} -e PROXY_HOSTS=${{ secrets.PROXY_HOSTS }} -e PROXY_USERNAME=${{ secrets.PROXY_USERNAME }} -e PROXY_PASSWORD=${{ secrets.PROXY_PASSWORD }} torrentio-addon:latest - docker image prune -f diff --git a/.github/workflows/deploy_addon.yml b/.github/workflows/deploy_addon.yml new file mode 100644 index 0000000..553ae41 --- /dev/null +++ b/.github/workflows/deploy_addon.yml @@ -0,0 +1,44 @@ +name: Deploy Addon + +on: + push: + branches: master + paths: + - 'addon/**' + +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 }} -e PROXY_HOSTS=${{ secrets.PROXY_HOSTS }} -e PROXY_USERNAME=${{ secrets.PROXY_USERNAME }} -e PROXY_PASSWORD=${{ secrets.PROXY_PASSWORD }} torrentio-addon:latest + docker image prune -f diff --git a/.github/workflows/deploy_scraper.yml b/.github/workflows/deploy_scraper.yml new file mode 100644 index 0000000..ee2293e --- /dev/null +++ b/.github/workflows/deploy_scraper.yml @@ -0,0 +1,44 @@ +name: Deploy Scraper + +on: + push: + branches: master + paths-ignore: + - 'addon/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Create Docker image + run: | + docker build -t torrentio-scraper:latest . + docker save torrentio-scraper:latest > torrentio_scraper_latest.tar + + - name: Upload Docker image + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SCRAPER_SSH_HOST }} + username: ${{ secrets.SCRAPER_SSH_USERNAME }} + port: ${{ secrets.SCRAPER_SSH_PORT }} + key: ${{ secrets.SCRAPER_SSH_KEY }} + source: torrentio_scraper_latest.tar + target: /tmp/docker + overwrite: true + + - name: Deploy Docker image + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SCRAPER_SSH_HOST }} + username: ${{ secrets.SCRAPER_SSH_USERNAME }} + port: ${{ secrets.SCRAPER_SSH_PORT }} + key: ${{ secrets.SCRAPER_SSH_KEY }} + script: | + docker load -i /tmp/docker/torrentio_scraper_latest.tar + docker stop torrentio-scraper + docker rm torrentio-scraper + docker run -p 80:7000 -d --name torrentio-scraper --restart always -e MONGODB_URI=${{ secrets.SCRAPER_MONGODB_URI }} -e DATABASE_URI=${{ secrets.DATABASE_URI }} -e ENABLE_SCHEDULING=true -e PROXY_HOST=${{ secrets.SCRAPER_PROXY_HOST }} -e PROXY_TYPE=${{ secrets.SCRAPER_PROXY_TYPE }} torrentio-scraper:latest + docker image prune -f diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..170df8e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:12-alpine + +RUN apk update && apk upgrade && \ + apk add --no-cache git + +WORKDIR /home/node/app + +COPY package*.json ./ +RUN npm ci --only-production +COPY . . + +CMD [ "node", "scraper/index.js" ] \ No newline at end of file diff --git a/Procfile b/Procfile deleted file mode 100644 index a7d75b5..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: node scraper/index.js \ No newline at end of file diff --git a/app.yaml b/app.yaml deleted file mode 100644 index cce46e4..0000000 --- a/app.yaml +++ /dev/null @@ -1,5 +0,0 @@ -runtime: nodejs12 - -env_variables: - DATABASE_URI: @database-uri - MONGODB_URI: @mongodb-uri \ No newline at end of file diff --git a/now.json b/now.json deleted file mode 100644 index cdb7bcb..0000000 --- a/now.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": 2, - "routes": [ - { - "src": "/(.*)", - "status": 308, - "headers": { - "Location": "https://torrentio.strem.fun/$1" - } - } - ], - "github": { - "silent": true - } -} -