Skip to content

fix: enable X.com previews (#896) #2511

fix: enable X.com previews (#896)

fix: enable X.com previews (#896) #2511

Workflow file for this run

name: CI - Node.js Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: ${{ matrix.node-version }}
- name: Set environment variables
run: cp sample.env .env
- name: Install dependencies
run: npm ci
- name: Lint source files
run: npm run lint
test:
name: Test
needs: lint
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x]
env:
BUILD_LANG: english
ENGLISH_GHOST_API_URL: ${{ secrets.CI_ENGLISH_GHOST_API_URL }}
ENGLISH_GHOST_API_VERSION: ${{ secrets.CI_ENGLISH_GHOST_API_VERSION }}
ENGLISH_GHOST_CONTENT_API_KEY: ${{ secrets.CI_ENGLISH_GHOST_CONTENT_API_KEY }}
POSTS_PER_PAGE: ${{ secrets.POSTS_PER_PAGE }}
SITE_DOMAIN: localhost:8080
LOCALE_FOR_UI: english
LOCALE_FOR_GHOST: english
steps:
- name: Checkout source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Login to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Start English Ghost container
run: npm run start:containers --service english
- name: Sleep for 5 seconds
run: sleep 5s
shell: bash
- name: Build English CI site
run: npm run build:ci
- name: Run tests
run: npm run test
- name: Stop Ghost containers
run: npm run stop:containers