Skip to content

Commit

Permalink
migrate from imgix (#25)
Browse files Browse the repository at this point in the history
* fix: πŸ› migrate from imgix

* test: πŸ’ fix int tests

* ci: 🎑 pass env var to ci unit
  • Loading branch information
jaskaransarkaria authored Dec 31, 2023
1 parent b0ac73f commit 6606a14
Show file tree
Hide file tree
Showing 52 changed files with 2,042 additions and 5,813 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 16.16
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
env:
PUBLIC_BUCKET_URL: https://storage.googleapis.com/enki-website
PUBLIC_SERVER_URL: http://localhost:8080
PUBLIC_STRIPE_KEY: pk_test_51HpvnTAk37gvJ51oYwywMtrDcDlL6FXuVY0aQ1EYEJUiw9MG70UElEMhhazqhhafUOslK1IugHRApQ7GWNUcnqT400dJ4HWjbp
run: npm run test:integration:ci
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
path: test-results/
retention-days: 30
6 changes: 4 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 16.16
- name: Install dependencies
run: npm ci
- name: Linting
run: npm run lint
- name: Unit tests
run: npm run test:unit:ci
env:
PUBLIC_BUCKET_URL: https://storage.googleapis.com/enki-website
2 changes: 2 additions & 0 deletions .kubernetes/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ spec:
spec:
containers:
- env:
- name: PUBLIC_BUCKET_URL
value: https://storage.googleapis.com/enki-website
- name: PUBLIC_SERVER_URL
value: https://server.enkionline.com
- name: PUBLIC_STRIPE_KEY
Expand Down
2 changes: 2 additions & 0 deletions .kubernetes/e2e-test-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
memory: "512Mi"
cpu: "125m"
env:
- name: PUBLIC_BUCKET_URL
value: https://storage.googleapis.com/enki-website
- name: PUBLIC_SERVER_URL
value: "https://server.enkionline.com"
- name: PUBLIC_STRIPE_KEY
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.2
v16.16
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN npm ci

COPY . ./

ENV PUBLIC_BUCKET_URL="https://storage.googleapis.com/enki-website"
ENV PUBLIC_SERVER_URL=https://server.enkionline.com
ENV PUBLIC_STRIPE_KEY="pk_live_51HpvnTAk37gvJ51oKXsYuAZsyletQkgqOky7L2yV9c9nDMj1koLPMvsC6sKBOCqveZMk8CHy730HDFSkiFsbzSRB0059ZpWGau"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ You may notice a few svelte ticks present across some of the tests, as reactive

## Site Images

The site pulls optimized images from Imgix service. To add a file to Imgix you must add the properly named file to the connected Imgix "source" in google cloud storage.
The site pulls optimized images from a public gcloud bucket. Everything in the bucket is cached for a year. we "bust" the cache using hashes generated on the server and stored in different places dependant on whether we are dealing with a category, product or tag.

To upload images to products and categories, via a ui see this [service](https://github.com/jaskaransarkaria/enki-upload-photos)

## CI/ CD

Travis CI handles the deployment pipeline deploying when a commit on master is tagged with the an incremented semver eg. v01.02.03
Argo CD handles the deployment pipeline deploying when a commit on main is tagged with the an incremented semver eg. v01.02.03

Once the deployment is initialised the container runs a pre-deployment hook to generate an upto date sitemap using `npm run sitemap-generator`. This also runs on a cron once a week early Wednesday morning.

Expand Down
Loading

0 comments on commit 6606a14

Please sign in to comment.