Skip to content

Commit

Permalink
Fifth Iteration of CI/CD (#93)
Browse files Browse the repository at this point in the history
* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* added description to the video url field in project creation form issue #50 (#61)

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu (#86)

* added functionality to show creators we are following (#83)

* added functionality to show creators we are following

* fixed issue #58: added functionality to show creators we are following --- patch

* ci/cd ---- test 1

* First Iteration of CI/CD workflow (#89)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* ci/cd ---- test 2

* Second Iteration of CI/CD (#90)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* ci/cd ---- test 2

* ci/cd ---- test 3

* third iteration of CI/CD (#91)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* ci/cd ---- test 2

* ci/cd ---- test 3

* Update build_deploy_backend.yml

manually added manual workflow dispatch to github actions file

* ci/cd ---- test 5 ---- patch
  • Loading branch information
NdibeRaymond authored Jan 26, 2021
1 parent 6dd4529 commit 4a4f55c
Show file tree
Hide file tree
Showing 31 changed files with 828 additions and 196 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/build_deploy_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
- master
paths:
- "*"
- "zubhub_backend/**"
- "!zubhub_backend/.gitignore"
- "!zubhub_backend/.env.example"
- "!zubhub_backend/.dockerignore"
workflow_dispatch:

jobs:
path-context:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
Expand All @@ -38,3 +38,28 @@ jobs:
tags: unstructuredstudio/zubhub-backend:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

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

steps:
- uses: actions/checkout@v1

- name: Copy file via scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.DO_BACKEND_HOST }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
KEY: ${{ secrets.DO_SSHKEY }}
with:
source: "."
target: "/home/zubhub-backend/zubhub"

- name: Executing remote command
uses: appleboy/ssh-action@master
with:
HOST: ${{ secrets.DO_BACKEND_HOST }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
KEY: ${{ secrets.DO_SSHKEY }}
script: "cp /home/zubhub-backend/zubhub/zubhub_backend/deploy_backend.sh /home/zubhub-backend/ && sudo bash /home/zubhub-backend/deploy_backend.sh"
58 changes: 28 additions & 30 deletions .github/workflows/build_deploy_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@ name: Frontend Production Deployment
on:
push:
branches:
- phase2
- master
paths:
- "zubhub_frontend/zubhub/"
- "zubhub_frontend/zubhub/**"
- "!zubhub_frontend/zubhub/README.md"
- "!zubhub_frontend/zubhub/.env.example"
- "!zubhub_frontend/zubhub/.prettierrc.yaml"
- "!zubhub_frontend/zubhub/.gitignore"
workflow_dispatch:

jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Checkout files
# uses: actions/checkout@v2
- name: Checkout files
uses: actions/checkout@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./zubhub_frontend/zubhub/
file: ./zubhub_frontend/zubhub/Dockerfile.prod
push: true
tags: unstructuredstudio/zubhub-frontend:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

# - name: Build and push
# id: docker_build
# uses: docker/build-push-action@v2
# with:
# context: ./zubhub_frontend/zubhub/
# file: ./zubhub_frontend/zubhub/Dockerfile.prod
# push: true
# tags: unstructuredstudio/zubhub-frontend:latest
# - name: Image digest
# run: echo ${{ steps.docker_build.outputs.digest }}

deploy:
# needs: build
needs: build
runs-on: ubuntu-latest

steps:
Expand All @@ -52,7 +52,6 @@ jobs:
env:
HOST: ${{ secrets.DO_FRONTEND_HOST }}
USERNAME: ${{ secrets.DO_FRONTEND_USERNAME }}
PORT: ${{ secrets.DO_SSHPORT }}
KEY: ${{ secrets.DO_SSHKEY }}
with:
source: "."
Expand All @@ -66,4 +65,3 @@ jobs:
PORT: ${{ secrets.DO_SSHPORT }}
KEY: ${{ secrets.DO_SSHKEY }}
script: "cp /home/zubhub-frontend/zubhub/zubhub_frontend/zubhub/deploy_frontend.sh /home/zubhub-frontend/ && sudo bash /home/zubhub-frontend/deploy_frontend.sh"

26 changes: 19 additions & 7 deletions zubhub_backend/deploy_backend.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
#! /bin/bash

mv zubhub_backend/.env zubhub/zubhub_backend/.env
rm -rf zubhub_backend
cp -r zubhub/zubhub_backend/ zubhub_backend/
rm -rf zubhub/ zubhub_backend/.env.example
cd zubhub_backend
docker-compose down
docker-compose -f ./docker-compose.prod.yml up -d --build
echo "copying .env file and ssl folder"
mv /home/zubhub-backend/zubhub_backend/.env /home/zubhub-backend/zubhub/zubhub_backend/.env
echo "done copying .env file and ssl folder"

echo "removing old project folder"
rm -rf /home/zubhub-backend/zubhub_backend
echo "done removing old project folder"

echo "coping new project folder"
cp -r /home/zubhub-backend/zubhub/zubhub_backend/ /home/zubhub-backend/zubhub_backend/
echo "done coping new project folder"

echo "removing uneccessary files and folders"
rm -rf /home/zubhub-backend/zubhub/ /home/zubhub-backend/zubhub_backend/.env.example
echo "done removing uneccessary files and folders"

echo "rebuilding containers"
docker-compose -f /home/zubhub-backend/zubhub_backend/docker-compose.prod.yml down
docker-compose -f /home/zubhub-backend/zubhub_backend/docker-compose.prod.yml up -d --build
echo "Updated backend"
# EOT
4 changes: 1 addition & 3 deletions zubhub_backend/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ version: "3.3"

services:
web:
image: unstructuredstudio/zubhub-backend:latest
env_file: .env
build:
context: .
dockerfile: ./Dockerfile
command: /start
restart: on-failure
environment:
Expand Down
5 changes: 4 additions & 1 deletion zubhub_backend/zubhub/creators/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ class Creator(AbstractUser):
location = models.ForeignKey(
Location, null=True, on_delete=models.SET_NULL)
bio = models.CharField(max_length=255, blank=True, null=True)
followers = models.ManyToManyField("self", symmetrical=False)
followers = models.ManyToManyField(
"self", symmetrical=False, related_name="following")
followers_count = models.IntegerField(blank=True, default=0)
following_count = models.IntegerField(blank=True, default=0)
projects_count = models.IntegerField(blank=True, default=0)

def save(self, *args, **kwargs):
self.avatar = 'https://robohash.org/{0}'.format(self.username)
self.followers_count = self.followers.count()
self.following_count = self.following.count()
self.projects_count = self.projects.count()
super().save(*args, **kwargs)
2 changes: 1 addition & 1 deletion zubhub_backend/zubhub/creators/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CreatorSerializer(serializers.ModelSerializer):
class Meta:
model = Creator
fields = ('id', 'username', 'email', 'avatar',
'dateOfBirth', 'bio', 'followers', 'projects_count')
'dateOfBirth', 'bio', 'followers', 'following_count', 'projects_count')


class LocationSerializer(serializers.ModelSerializer):
Expand Down
2 changes: 2 additions & 0 deletions zubhub_backend/zubhub/creators/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
UserProjectsAPIView.as_view(), name="user_projects"),
path('<str:username>/followers/',
UserFollowersAPIView.as_view(), name='user_followers'),
path('<str:username>/following/',
UserFollowingAPIView.as_view(), name='user_following'),
path('<str:username>/', UserProfileAPIView.as_view(), name='user_profile'),
path('<uuid:pk>/toggle_follow/',
ToggleFollowAPIView.as_view(), name="toggle_follow")
Expand Down
11 changes: 11 additions & 0 deletions zubhub_backend/zubhub/creators/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def get_queryset(self):
return Creator.objects.get(username=username).followers.all()


class UserFollowingAPIView(ListAPIView):
serializer_class = CreatorSerializer
permission_classes = [AllowAny]
pagination_class = CreatorNumberPagination

def get_queryset(self):
username = self.kwargs.get("username")
return Creator.objects.get(username=username).following.all()


class ToggleFollowAPIView(RetrieveAPIView):
serializer_class = CreatorSerializer
queryset = Creator.objects.all()
Expand All @@ -83,6 +93,7 @@ def get_object(self):
else:
obj.followers.add(self.request.user)
obj.save()
self.request.user.save()

return obj

Expand Down
3 changes: 3 additions & 0 deletions zubhub_frontend/zubhub/deploy_frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ echo "changing permission of cert storage folder"
sudo chown -R nobody:nogroup /home/zubhub-frontend/zubhub_frontend/zubhub/.ssl-data/storage
echo "done changing permission of cert storage folder"

echo "removing uneccessary files and folders"
rm -rf /home/zubhub-frontend/zubhub
rm -rf /home/zubhub-frontend/zubhub_frontend/zubhub/.env.example
rm -rf /home/zubhub-frontend/zubhub_frontend/zubhub/Dockerfile
rm -rf /home/zubhub-frontend/zubhub_frontend/zubhub/docker-compose.yml
rm -rf /home/zubhub-frontend/zubhub_frontend/zubhub/nginx/dev
echo "done removing uneccessary files and folders"



Expand Down
14 changes: 6 additions & 8 deletions zubhub_frontend/zubhub/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
version: "3.3"
version: '3.3'

services:
zubhub_frontend:
image: unstructuredstudio/zubhub-frontend:latest
container_name: zubhub_frontend
build:
context: .
dockerfile: Dockerfile.prod
volumes:
- ./nginx/prod/default.conf:/etc/nginx/conf.d/default.conf
restart: on-failure
ports:
- "80"
- '80'

reverse-proxy:
image: valian/docker-nginx-auto-ssl:1.0.0
Expand All @@ -22,9 +20,9 @@ services:
volumes:
- ./.ssl-data:/etc/resty-auto-ssl
environment:
ALLOWED_DOMAINS: "(zubhub|www.zubhub).unstructured.studio"
SITES: "zubhub.unstructured.studio=zubhub_frontend;www.zubhub.unstructured.studio=zubhub_frontend"
FORCE_HTTPS: "true"
ALLOWED_DOMAINS: '(zubhub|www.zubhub).unstructured.studio'
SITES: 'zubhub.unstructured.studio=zubhub_frontend;www.zubhub.unstructured.studio=zubhub_frontend'
FORCE_HTTPS: 'true'
depends_on:
- zubhub_frontend

Expand Down
4 changes: 2 additions & 2 deletions zubhub_frontend/zubhub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.3"
version: '3.3'

services:
zubhub_frontend:
Expand All @@ -10,4 +10,4 @@ services:
- ./nginx/dev/default.conf:/etc/nginx/conf.d/default.conf
restart: on-failure
ports:
- "3000:3000"
- '3000:3000'
27 changes: 27 additions & 0 deletions zubhub_frontend/zubhub/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion zubhub_frontend/zubhub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@testing-library/user-event": "^12.2.2",
"aws-sdk": "^2.813.0",
"classnames": "^2.2.6",
"compressorjs": "^1.0.7",
"date-fns": "^2.16.1",
"formik": "^2.2.5",
"nanoid": "^3.1.20",
Expand All @@ -27,6 +28,7 @@
"redux-thunk": "^2.3.0",
"slick-carousel": "^1.8.1",
"web-vitals": "^0.2.4",
"workerize-loader": "^1.3.0",
"yup": "^0.29.3"
},
"scripts": {
Expand Down Expand Up @@ -55,6 +57,6 @@
]
},
"devDependencies": {
"prettier": "2.2.1"
"prettier": "^2.2.1"
}
}
Loading

0 comments on commit 4a4f55c

Please sign in to comment.