From 9a4d57ff990cee77b687348f2745984124ab0b62 Mon Sep 17 00:00:00 2001 From: sinatayebati Date: Sun, 19 May 2024 20:54:53 -0500 Subject: [PATCH] #18 deploy project --- .github/workflows/deploy.yml | 11 +++++++- Dockerfile | 5 +--- package.json | 50 ++++++++++++++++++------------------ 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5e219bf..b8f456e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,8 +24,17 @@ jobs: - name: Build project run: npm run build + - name: Build Docker image + run: docker build -t vue-pdf-annotate . + + - name: Deploy Docker container to GitHub Pages + run: | + docker run -d -p 5173:5173 pdf-annotate + docker cp $(docker ps -ql):/app/dist ./dist + docker stop $(docker ps -ql) + - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: - personal_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GH_TOKEN }} publish_dir: ./dist diff --git a/Dockerfile b/Dockerfile index 18beb30..ff0cbf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,11 +16,8 @@ COPY . . # Build the application RUN npm run build -# Install a lightweight HTTP server -RUN npm install -g serve - # Expose the port the app runs on EXPOSE 5173 # Command to run the app -CMD ["serve", "-s", "dist", "-l", "5173"] +CMD ["npm", "run", "dev"] \ No newline at end of file diff --git a/package.json b/package.json index c7465c2..bdd6e62 100644 --- a/package.json +++ b/package.json @@ -2,33 +2,33 @@ "name": "vuetify-project", "version": "0.0.0", "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "predeploy": "npm run build", - "deploy": "gh-pages -d dist" + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "predeploy": "npm run build", + "deploy": "gh-pages -d dist" }, "dependencies": { - "@mdi/font": "5.9.55", - "@okta/okta-auth-js": "^7.4.0", - "@okta/okta-vue": "^5.6.0", - "annotpdf": "1.0.15", - "axios": "^1.1.3", - "pdfjs-dist": "4.2.67", - "pinia": "^2.0.23", - "roboto-fontface": "*", - "sass": "^1.56.1", - "vue": "^3.4.7", - "vue-router": "4", - "vuetify": "^3.5.3", - "webfontloader": "^1.0.0" + "@mdi/font": "5.9.55", + "@okta/okta-auth-js": "^7.4.0", + "@okta/okta-vue": "^5.6.0", + "axios": "^1.1.3", + "pinia": "^2.0.23", + "roboto-fontface": "*", + "sass": "^1.56.1", + "vue": "^3.4.7", + "vue-router": "4", + "vuetify": "^3.5.3", + "webfontloader": "^1.0.0", + "pdfjs-dist": "4.2.67", + "annotpdf": "1.0.15" }, "devDependencies": { - "@vitejs/plugin-vue": "^4.1.0", - "gh-pages": "^6.0.0", - "http-server": "^14.1.1", - "vite": "^4.5.3", - "vite-plugin-vuetify": "^1.0.0-alpha.12", - "vite-svg-loader": "5.1.0" + "@vitejs/plugin-vue": "^4.1.0", + "vite": "^4.5.3", + "vite-plugin-vuetify": "^1.0.0-alpha.12", + "vite-svg-loader": "5.1.0", + "gh-pages": "^3.2.3" } -} + } + \ No newline at end of file