chore(deps): update github actions #2936
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 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] | |
languages: [english, espanol] | |
env: | |
POSTS_PER_PAGE: ${{ secrets.POSTS_PER_PAGE }} | |
HASHNODE_API_URL: api_url_from_hashnode_dashboard | |
ENGLISH_HASHNODE_HOST: host_from_hashnode_dashboard | |
ESPANOL_GHOST_API_URL: ${{ secrets.CI_ESPANOL_GHOST_API_URL }} | |
ESPANOL_GHOST_API_VERSION: ${{ secrets.CI_ESPANOL_GHOST_API_VERSION }} | |
ESPANOL_GHOST_CONTENT_API_KEY: ${{ secrets.CI_ESPANOL_GHOST_CONTENT_API_KEY }} | |
SITE_DOMAIN: localhost:8080 | |
LOCALE_FOR_UI: ${{ matrix.languages }} | |
LOCALE_FOR_GHOST: ${{ matrix.languages }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Set fetch from Ghost environment variable | |
if: ${{ matrix.languages == 'english' }} | |
run: echo "DO_NOT_FETCH_FROM_GHOST=true" >> $GITHUB_ENV | |
- name: Start Espanol Ghost container | |
if: ${{ matrix.languages == 'espanol' }} | |
run: npm run start:containers --service espanol | |
- name: Sleep for 5 seconds | |
if: ${{ matrix.languages == 'espanol' }} | |
run: sleep 5s | |
shell: bash | |
- name: Build CI site | |
run: npm run build:ci | |
- name: Run tests | |
run: npm run test | |
- name: Perform Typescript Typecheck | |
run: npm run type-check | |
- name: Stop Ghost containers | |
if: ${{ matrix.languages == 'espanol' }} | |
run: npm run stop:containers |