Skip to content

Commit

Permalink
Upgrade to Nuxt V3 (#63)
Browse files Browse the repository at this point in the history
* Refactor project structure

* Update to nuxt v3

* Fix build

* Fix categorization and links

* Remove file that should be ignored

* Fix build

* Fix test run

* Update CI tasks
- Increment versions to improve performance and upload the right directory

* Fix dependency tree

* Allow optional dependencies to be installed

* Regenerate package lock

* Fix artifact download version

* Fix feature test step

* Add workaround for browser...
- See: microsoft/playwright#6500

* Ensure we don't build twice for tests
  • Loading branch information
tajdeluca authored Jan 2, 2024
1 parent ce0ef04 commit f499710
Show file tree
Hide file tree
Showing 53 changed files with 10,139 additions and 29,176 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
# Checkout
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
Expand All @@ -31,17 +31,17 @@ jobs:
${{ runner.os }}-
# Setup NodeJS
- name: Setup Node.js environment
uses: actions/setup-node@v1.4.4
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
# Install dependencies
- name: NPM CI
run: npm ci --no-optional
run: npm ci
# Nuxt Generate
- name: Nuxt Generate
run: npm run generate --fail-on-error
run: npm run generate
- name: Store Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: dist
path: src/.output/public
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ${{ inputs.runner }}
steps:
# Download previous build
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.build_artifact_name }}
path: dist
Expand All @@ -56,7 +56,7 @@ jobs:
SOURCE_DIR: 'dist'
# Install Python
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
# Install pip and s3cmd
Expand All @@ -69,7 +69,7 @@ jobs:
run: s3cmd --access_key "${{ secrets.AWS_ACCESS_KEY_ID }}" --secret_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}" --region "${{ inputs.aws_region }}" --recursive modify --add-header "Cache-Control:max-age=2592000" --exclude "*.html" --exclude "*.ico" s3://${{ secrets.AWS_S3_BUCKET }}/
# Invalidate Cloudfront
- name: Invalidate CloudFront Caches
uses: chetan/invalidate-cloudfront-action@master
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/*'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
uses: ./.github/workflows/build.yml
with:
artifact_name: 'build'
node_version: '16.x'
node_version: '20.x'
runner: 'ubuntu-latest'
test:
name: 'Test'
needs: build
uses: ./.github/workflows/test.yml
with:
build_artifact_name: 'build'
node_version: '16.x'
node_version: '20.x'
runner: 'ubuntu-latest'
test_base_url: 'http://localhost:3000'
test_is_against_deployment: false
Expand All @@ -46,7 +46,7 @@ jobs:
uses: ./.github/workflows/test.yml
with:
build_artifact_name: 'build'
node_version: '16.x'
node_version: '20.x'
runner: 'ubuntu-latest'
test_base_url: 'https://beta.tajdeluca.com'
test_is_against_deployment: true
Expand All @@ -73,7 +73,7 @@ jobs:
uses: ./.github/workflows/test.yml
with:
build_artifact_name: 'build'
node_version: '16.x'
node_version: '20.x'
runner: 'ubuntu-latest'
test_base_url: 'https://tajdeluca.com'
test_is_against_deployment: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
uses: ./.github/workflows/build.yml
with:
artifact_name: 'build'
node_version: '16.x'
node_version: '20.x'
runner: 'ubuntu-latest'
test:
name: 'Test'
needs: build
uses: ./.github/workflows/test.yml
with:
build_artifact_name: 'build'
node_version: '16.x'
node_version: '20.x'
runner: 'ubuntu-latest'
test_base_url: 'http://localhost:3000'
test_is_against_deployment: false
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ on:
jobs:
test:
runs-on: ${{ inputs.runner }}
container: 'mcr.microsoft.com/playwright:v1.21.1-focal'
container: 'mcr.microsoft.com/playwright:v1.40.1-focal'
steps:
# Checkout
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
Expand All @@ -40,35 +40,35 @@ jobs:
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-
# Download previous build
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
if: ${{ inputs.test_is_against_deployment == false }}
with:
name: ${{ inputs.build_artifact_name }}
path: dist
path: src/.output/public
# Setup NodeJS
- name: Setup Node.js environment
uses: actions/setup-node@v1.4.4
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
# Install dependencies
- name: NPM CI
run: npm ci
- name: Run Playwright tests for feature
if: ${{ inputs.test_is_against_deployment == false }}
run: npm test --ignore-scripts
run: HOME=/root npm test --ignore-scripts
env:
CI: 'anything'
TEST_BASE_URL: ${{ inputs.test_base_url }}
- name: Run Playwright tests
if: ${{ inputs.test_is_against_deployment }}
run: npm test --ignore-scripts
run: HOME=/root npm test --ignore-scripts
env:
CI: 'anything'
TEST_BASE_URL: ${{ inputs.test_base_url }}
TEST_IS_AGAINST_DEPLOYMENT: 'anything'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.test_report_artifact_name }}
path: playwright-report/
path: test/integration/playwright-report/
retention-days: 30
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typings/

# Nuxt generate
dist
.output

# vuepress build output
.vuepress/dist
Expand All @@ -89,9 +90,7 @@ sw.*
# Vim swap files
*.swp

# Cypress
cypress/screenshots
cypress/videos
/test-results/
/playwright-report/
/playwright/.cache/
# Tests
test-results/
playwright-report/
playwright/.cache/
39 changes: 0 additions & 39 deletions components/ArticleCategory.vue

This file was deleted.

7 changes: 0 additions & 7 deletions components/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions layouts/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions middleware/README.md

This file was deleted.

87 changes: 0 additions & 87 deletions nuxt.config.js

This file was deleted.

Loading

0 comments on commit f499710

Please sign in to comment.