From 71b47d298e9137823c8eb4cd42cfffd98cc8a47b Mon Sep 17 00:00:00 2001 From: flockean Date: Mon, 6 May 2024 12:58:43 +0200 Subject: [PATCH] ci: Workflow --- .github/workflows/build_deploy.yaml | 44 +++++++++++++++++++++++++++++ .gitignore | 9 +----- .vscode/extensions.json | 4 --- .vscode/launch.json | 20 ------------- .vscode/tasks.json | 42 --------------------------- angular.json | 3 ++ 6 files changed, 48 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/build_deploy.yaml delete mode 100644 .vscode/extensions.json delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/tasks.json diff --git a/.github/workflows/build_deploy.yaml b/.github/workflows/build_deploy.yaml new file mode 100644 index 0000000..fbca56f --- /dev/null +++ b/.github/workflows/build_deploy.yaml @@ -0,0 +1,44 @@ +name: Angular Build and Deploy + +on: + push: + branches: [ "master" ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + + - name: Install Angular CLI + run: npm install -g @angular/cli + + - name: Install Deps + run: npm install + + - name: Build Angular project + run: ng build --prod + + - name: Copy dist files to deployment folder + run: cp -r dist/* deployment/ + + - name: Deploy to web server + uses: actions/upload-artifact@v3 + with: + name: deployment + path: deployment + + - name: Upload build artifacts + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + server: '${{ env.SERVER_HOST }}' # Replace with your server details + username: '${{ env.SERVER_USER }}' + password: '${{ env.SERVER_KEY }}' # Use stored environment variable + local-dir: dist/lucas-web/browser/ # Directory containing built Angular files + diff --git a/.gitignore b/.gitignore index 0711527..f8d979f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,14 +20,6 @@ yarn-error.log .settings/ *.sublime-workspace -# Visual Studio Code -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* - # Miscellaneous /.angular/cache .sass-cache/ @@ -40,3 +32,4 @@ testem.log # System files .DS_Store Thumbs.db +/.vscode/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 77b3745..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 - "recommendations": ["angular.ng-template"] -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 925af83..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "ng serve", - "type": "chrome", - "request": "launch", - "preLaunchTask": "npm: start", - "url": "http://localhost:4200/" - }, - { - "name": "ng test", - "type": "chrome", - "request": "launch", - "preLaunchTask": "npm: test", - "url": "http://localhost:9876/debug.html" - } - ] -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index a298b5b..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "start", - "isBackground": true, - "problemMatcher": { - "owner": "typescript", - "pattern": "$tsc", - "background": { - "activeOnStart": true, - "beginsPattern": { - "regexp": "(.*?)" - }, - "endsPattern": { - "regexp": "bundle generation complete" - } - } - } - }, - { - "type": "npm", - "script": "test", - "isBackground": true, - "problemMatcher": { - "owner": "typescript", - "pattern": "$tsc", - "background": { - "activeOnStart": true, - "beginsPattern": { - "regexp": "(.*?)" - }, - "endsPattern": { - "regexp": "bundle generation complete" - } - } - } - } - ] -} diff --git a/angular.json b/angular.json index 431bf72..f127fb2 100644 --- a/angular.json +++ b/angular.json @@ -97,5 +97,8 @@ } } } + }, + "cli": { + "analytics": "143922bb-ef83-46f8-a203-b18b9edfd528" } }