Skip to content
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

various enhancements, ci activation #303

Merged
merged 26 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'publish'

on:
push:
branches:
- master
- dev
- '*'
tags:
- '*'

jobs:
build:
name: 'Build and publish'
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
env:
SKIP_YARN_COREPACK_CHECK: true

- run: |
corepack enable

- run: |
yarn set version berry

- name: setup git config
run: |
git config user.name "Salim Kanoun"
git config user.email "[email protected]"

- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/pixilib/gaelo-flow-frontend
tags: |
type=ref,event=branch
type=ref,event=tag
latest

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to github registery
uses: docker/login-action@v3
with:
registry: ghcr.io
username: 'salimkanoun'
password: ${{ secrets.GITHUB_TOKEN }}

- run: yarn install

- name: 'set version'
if: github.ref_type == 'tag'
run: yarn version --new-version ${{ github.ref_name }}

- run : yarn build

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
pull: true
tags: ${{ steps.meta.outputs.tags }}

permissions:
contents: read
packages: write
925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.4.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.1.cjs
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Nginx
FROM nginx:1.23.3

ENV NGINX_SERVER_NAME='nginx'
ENV NGINX_PORT='80'

COPY default.conf.template /etc/nginx/templates/default.conf.template
COPY ./dist /usr/share/nginx/html
20 changes: 20 additions & 0 deletions default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
server_name ${NGINX_SERVER_NAME};
listen ${NGINX_PORT};
server_tokens off;

real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 0.0.0.0/0;

root /usr/share/nginx/html;

add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;

index index.html;

location / {
try_files $uri /index.html;
}
}
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/gaelo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>GaelO-Flow</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script src="./node_modules/preline/dist/preline.js"></script>
<script type="module" src="./node_modules/preline/dist/preline.js"></script>
</body>
</html>
Loading
Loading