forked from PoolC/Haribo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from PoolC/feature
- Loading branch information
Showing
11 changed files
with
637 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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,30 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env | ||
.env.development | ||
.env.production | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.idea | ||
|
||
__generated__ |
This file contains 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,43 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: setting env | ||
run: | | ||
# env file | ||
$ENV_PRODUCTION=.env.production | ||
echo "VITE_API_BASE_URL=$secrets.VITE_API_BASE_URL" > $ENV_PRODUCTION | ||
echo "VITE_FILE_URL=$secrets.VITE_FILE_URL" > $ENV_PRODUCTION | ||
echo "VITE_MAX_FILE_SIZE=$secrets.VITE_MAX_FILE_SIZE" > $ENV_PRODUCTION | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/my-container-test:latest | ||
ghcr.io/${{ github.repository_owner }}/my-container-test:${{ env.RELEASE_VERSION }} | ||
This file contains 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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
FROM nginx:1.19.8 | ||
FROM node:18-alpine | ||
|
||
WORKDIR /var/www/poolc.org | ||
COPY ./build . | ||
COPY ./nginx.conf /etc/nginx/conf.d/poolc.org.conf | ||
WORKDIR /app | ||
|
||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn | ||
|
||
COPY . . | ||
|
||
RUN yarn codegen | ||
CMD yarn build | ||
|
||
VOLUME ["/app/build"] | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains 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,26 @@ | ||
version: '1' | ||
services: | ||
app: | ||
build: | ||
dockerfile: Dockerfile | ||
env_file: .env.production | ||
environment: | ||
- VITE_API_BASE_URL=$VITE_API_BASE_URL | ||
- VITE_FILE_URL=$VITE_FILE_URL | ||
- VITE_MAX_FILE_SIZE=$VITE_MAX_FILE_SIZE | ||
stdin_open: true | ||
volumes: | ||
- app-assets:/app/build | ||
|
||
web: | ||
build: | ||
dockerfile: nginx.Dockerfile | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- web-logs:/var/log/nginx | ||
- app-assets:/var/www | ||
|
||
volumes: | ||
web-logs: | ||
app-assets: |
This file contains 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 @@ | ||
FROM nginx:alpine | ||
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
VOLUME ["/var/log/nginx", "/var/www"] |
This file contains 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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
gzip on; | ||
gzip_disable "msie6"; | ||
gzip_comp_level 6; | ||
gzip_min_length 500; | ||
gzip_buffers 16 8k; | ||
gzip_proxied any; | ||
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css; | ||
|
||
server { | ||
root /var/www/poolc.org; | ||
index index.html; | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
|
||
gzip on; | ||
gzip_vary on; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
location / { | ||
try_files $uri /index.html; | ||
root /var/www; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
listen 8080 default_server; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.