-
Notifications
You must be signed in to change notification settings - Fork 11.7k
added github workflows; added dockerfile; added docker-compose; #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # .env file | ||
| .env | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.js | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # local env files | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| .env.example | ||
|
|
||
| # vercel | ||
| .vercel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Build Master | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Get current time | ||
| uses: 1466587594/get-current-time@v2 | ||
| id: current-time | ||
| with: | ||
| format: YYYY-MM-DD--HH | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v1 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v1 | ||
|
|
||
| - name: Cache Docker layers | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: /tmp/.buildx-cache | ||
| key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-buildx- | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.CR_PAT }} | ||
|
|
||
| - name: Login to DockerHub | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v2 | ||
| with: | ||
| platforms: linux/amd64,linux/arm64,linux/arm | ||
| push: true | ||
| tags: | | ||
| calendso/calendso | ||
| calendso/calendso:latest-${{ steps.current-time.outputs.formattedTime }} | ||
| ghcr.io/calendso/calendso | ||
| ghcr.io/calendso/calendso:latest-${{ steps.current-time.outputs.formattedTime }} | ||
| ghcr.io/calendso/calendso | ||
| ghcr.io/calendso/calendso:latest-${{ steps.current-time.outputs.formattedTime }} | ||
| cache-from: type=local,src=/tmp/.buildx-cache | ||
| cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: manual-dispatch | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release: | ||
| description: 'Tag/Release to deploy' | ||
| required: true | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Get current time | ||
| uses: 1466587594/get-current-time@v2 | ||
| id: current-time | ||
| with: | ||
| format: YYYY-MM-DD--HH | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| ref: ${{ github.event.inputs.release }} | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v1 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v1 | ||
|
|
||
| - name: Cache Docker layers | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: /tmp/.buildx-cache | ||
| key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-buildx- | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.CR_PAT }} | ||
|
|
||
| - name: Login to DockerHub | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v2 | ||
| with: | ||
| platforms: linux/amd64,linux/arm64,linux/arm | ||
| push: true | ||
| build-args: | | ||
| VUE_APP_VERSION=${{ github.event.inputs.release }} | ||
| tags: | | ||
| calendso/calendso:${{ github.event.inputs.release }} | ||
| ghcr.io/calendso/calendso:${{ github.event.inputs.release }} | ||
| cache-from: type=local,src=/tmp/.buildx-cache | ||
| cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FROM node:14.16.1-alpine3.13 as build-stage | ||
| WORKDIR /app | ||
| COPY ./ . | ||
| RUN yarn install | ||
| RUN npm run build | ||
|
|
||
| FROM lsiobase/alpine:3.13 as deploy-stage | ||
| WORKDIR /app | ||
| RUN \ | ||
| echo "**** install build packages ****" && \ | ||
| apk add --no-cache \ | ||
| nginx \ | ||
| npm &&\ | ||
| echo "**** Installing NPX ****" &&\ | ||
| npm install &&\ | ||
| echo "**** Cleaning Up ****" &&\ | ||
| rm -rf \ | ||
| /root/.cache \ | ||
| /tmp/* | ||
| COPY root / | ||
| COPY --from=build-stage /app/.next/ /app | ||
| COPY nginx.conf /etc/nginx/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| version: "3.1" | ||
|
|
||
| services: | ||
| db: | ||
| image: postgres | ||
| restart: always | ||
| environment: | ||
| POSTGRES_PASSWORD: ${DB_PASS:-changeme} | ||
|
|
||
| calendoso: | ||
| build: . | ||
| restart: always | ||
| ports: | ||
| - 3000:3000/tcp | ||
| environment: | ||
| - DATABASE_URL='postgresql://root:${DB_PASS:-changeme}@db:5432' | ||
| - GOOGLE_API_CREDENTIALS='secret' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| user abc abc; | ||
| error_log /var/log/nginx/error.log warn; | ||
| pid /var/run/nginx.pid; | ||
|
|
||
| http { | ||
| include /etc/nginx/mime.types; | ||
| ### Set http options | ||
| # fallback in case we can't determine a type | ||
| default_type application/octet-stream; | ||
| access_log /var/log/nginx/access.log combined; | ||
| sendfile on; | ||
| keepalive_timeout 5; | ||
|
|
||
| map $http_upgrade $connection_upgrade { | ||
| default upgrade; | ||
| '' close; | ||
| } | ||
|
|
||
| server { | ||
| listen *:3000; | ||
|
|
||
| # Next | ||
| location / { | ||
| root /app; | ||
| index index.html; | ||
| try_files $uri $uri/ /index.html; | ||
| } | ||
| error_page 500 502 503 504 /50x.html; | ||
|
|
||
| location = /50x.html { | ||
| root /usr/share/nginx/html; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/with-contenv bash | ||
|
|
||
| # permissions | ||
| chown -R abc:abc \ | ||
| /app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/usr/bin/with-contenv bash | ||
|
|
||
| cd /app | ||
| npx prisma db push --preview-feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/with-contenv bash | ||
|
|
||
| #killall nginx | ||
|
|
||
| if pgrep -f "[n]ginx:" > /dev/null; then | ||
| pkill -ef [n]ginx: | ||
| fi | ||
|
|
||
| exec nginx -c /etc/nginx/nginx.conf -g "daemon off;" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.