diff --git a/.github/workflows/jekyll-docker.yml b/.github/workflows/jekyll-docker.yml new file mode 100644 index 000000000..4943c9cc7 --- /dev/null +++ b/.github/workflows/jekyll-docker.yml @@ -0,0 +1,20 @@ +name: Jekyll site CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the site in the jekyll/builder container + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml new file mode 100644 index 000000000..0b4b9a25b --- /dev/null +++ b/.github/workflows/nextjs.yml @@ -0,0 +1,95 @@ +# Sample workflow for building and deploying a Next.js site to GitHub Pages +# +# To get started with Next.js see: https://nextjs.org/docs/getting-started +# +name: Deploy Next.js site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine packager manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "16" + cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages + uses: actions/configure-pages@v3 + with: + # Automatically inject basePath in your Next.js configuration file and disable + # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: next + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + .next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Build with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next build + - name: Static HTML export with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next export + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./out + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 402eeb701..e005e30ff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ on: - 'v*' env: - DOCKER_REPO_NAME: kaw393939/mywebclass + DOCKER_REPO_NAME: sumansmhalsank11/mywebclass_simulation jobs: build: diff --git a/docker-compose.yml b/docker-compose.yml index 80050ddea..08289e571 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,32 @@ version: "3.8" services: - master_branch: - development_branch: - image: kaw393939/mywebclass:development - container_name: development_branch - pull_policy: always - restart: always - ports: - - "8000:80" - labels: - - 'com.centurylinklabs.watchtower.enable=true' - watchtower: - image: containrrr/watchtower - container_name: watchtower - restart: always - command: '--interval 30 --label-enable --cleanup' - volumes: + master_branch: + image: sumansmhalsank11/mywebclass_simulation:master + container_name: master_branch + pull_policy: always + restart: always + ports: + - "8001:80" + labels: + - 'com.centurylinklabs.watchtower.enable=true' + + development_branch: + image: sumansmhalsank11/mywebclass_simulation:development + container_name: development_branch + pull_policy: always + restart: always + ports: + - "8000:80" + labels: + - 'com.centurylinklabs.watchtower.enable=true' + + watchtower: + image: containrrr/watchtower + container_name: watchtower + restart: always + command: '--interval 30 --label-enable --cleanup' + volumes: - /var/run/docker.sock:/var/run/docker.sock - labels: + labels: - 'com.centurylinklabs.watchtower.enable: true' diff --git a/mywebclass_internationalization.spec.js b/mywebclass_internationalization.spec.js new file mode 100644 index 000000000..f292379c9 --- /dev/null +++ b/mywebclass_internationalization.spec.js @@ -0,0 +1,26 @@ +import { test, expect } from '@playwright/test' + +test.describe('MyWebClass.org internationalization', () => { + let page + + test.beforeEach(async ({ browser }) => { + page = await browser.newPage() + await page.goto('http://localhost:3000') + }) + + test.afterEach(async () => { + await page.close() + }) + + test('should display the site in "en" when the "Accept-Language" header is set to "en"', async () => { + // Set the Accept-Language header and navigate to the website + await page.setExtraHTTPHeaders({ 'Accept-Language': 'en' }) + await page.goto('http://localhost:3000') + + // Check if the lang attribute of the HTML tag is set to "en" + const langAttribute = await page.getAttribute('html', 'lang') + expect(langAttribute).toBe('en', 'The lang attribute of the HTML tag is not set to "en".') + + // Perform any additional checks for the "en" language version of the website here, e.g., checking specific text or elements + }) +}) \ No newline at end of file diff --git a/package.json b/package.json index 9a0bbb78d..40c9e4931 100644 --- a/package.json +++ b/package.json @@ -25,14 +25,14 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/NJIT-WIS/mywebclass.git" + "url": "git+https://github.com/Sumanmhalsank02/mywebclass-simulation.git" }, - "author": "Keith Williams @ NJIT.EDU", + "author": "Suman S Mhalsank @ NJIT.EDU", "license": "MIT", "bugs": { - "url": "https://github.com/NJIT-WIS/mywebclass/issues" + "url": "https://github.com/Sumanmhalsank02/mywebclass-simulation/issues" }, - "homepage": "https://github.com/NJIT-WIS/mywebclass#readme", + "homepage": "https://github.com/Sumanmhalsank02/mywebclass-simulation#readme", "devDependencies": { "@playwright/test": "^1.31.1", "autoprefixer": "^10.4.13", @@ -61,5 +61,10 @@ }, "dependencies": { "@popperjs/core": "^2.11.6" + }, + + "overrides": { + "graceful-fs": "^4.2.10" + } + } -} diff --git a/productivity_log.md b/productivity_log.md new file mode 100644 index 000000000..373252ee8 --- /dev/null +++ b/productivity_log.md @@ -0,0 +1,8 @@ + +## Team Productivity Log +This log is to track issue title,story points, issue link, status, assigned to, assigned on, completed on, category, status notes. + +| Issue Title | Story Points | Issue Link | Status | Assigned to | Assigned on | Completed on | Category | Status notes | +|:---------------------|:------------:|-------------:|------------:|------------:|------------:|------------:|------------:|------------:| +| Homepage Development | 1 | | Completed | Srinivas Bojja | 18 March '23 | 19 March '23 | Website Feature | Made Changes to the weclass simulation | +| Internationalization | 2 | | In Progress | \ No newline at end of file diff --git a/src/index.html b/src/index.html index ad76fc58c..0e4b35664 100644 --- a/src/index.html +++ b/src/index.html @@ -2,6 +2,14 @@
+ +