This commit is contained in:
EsioFreitas 2022-10-26 14:43:29 -03:00
commit 7f385c0bd0
8 changed files with 117 additions and 3 deletions

View File

@ -3,6 +3,9 @@ require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = { module.exports = {
root: true, root: true,
env: {
node: true,
},
extends: [ extends: [
"plugin:vue/vue3-essential", "plugin:vue/vue3-essential",
"eslint:recommended", "eslint:recommended",

27
.github/workflows/cd.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Deploy FrontEnd
on:
push:
branches: [ main ]
jobs:
deploy-frontend:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: 🏗 Install dependencies
run: npm ci
- name: 📦 Build app bundle
run: npm run build --if-present
- name: 📦 Deploy to netlify
run: netlify deploy --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --site p2pix --prod

41
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: CI script
on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: 🏗 Install dependencies
run: npm ci
- name: 📦 Lint with eslint
run: npm run lint
build:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 📦 Build docker image
run: |
docker build -t p2pix:$GITHUB_SHA .
docker save -o image_$GITHUB_SHA p2pix:$GITHUB_SHA
- name: 📦 Put docker image in cache
uses: actions/cache@v3
with:
key: p2pix
path: image_${{ github.sha }}
# test job

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM node:lts-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY ./ ./
EXPOSE 3000
CMD ["npm", "run", "start"]

21
LICENSE.md Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 liftlearning
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '3.8'
services:
p2pix:
container_name: p2pix_frontend
build:
context: .
volumes:
- '.:/app'
ports:
- '3000:3000'

View File

@ -2,13 +2,14 @@
"name": "p2pix-front-end", "name": "p2pix-front-end",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"start": "vite", "start": "vite --host=0.0.0.0 --port 3000",
"build": "run-p type-check build-only", "build": "run-p type-check build-only",
"preview": "vite preview", "preview": "vite preview",
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build-only": "vite build", "build-only": "vite build",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore --fix"
}, },
"dependencies": { "dependencies": {
"@headlessui/vue": "^1.7.3", "@headlessui/vue": "^1.7.3",

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import TheWelcome from '../components/TheWelcome.vue' import TheWelcome from "../components/TheWelcome.vue";
</script> </script>
<template> <template>