build(deps): bump the minorandpatch group across 1 directory with 9 u… #177
Workflow file for this run
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: website | |
on: | |
push: | |
env: | |
REGISTRY: ghcr.io | |
DOCKER_IMAGE_NAME: ghcr.io/JonasKellerer/variation/website | |
defaults: | |
run: | |
working-directory: ./website | |
jobs: | |
checks: | |
name: Website Check format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache yarn | |
uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('variation/**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn --immutable | |
- name: Check format | |
run: yarn lint | |
unitTests: | |
name: Website Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache yarn | |
uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('variation/**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn --immutable | |
- name: Run tests | |
run: yarn test | |
dockerImage: | |
name: Build Website Docker Image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: dockerMetadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }} | |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | |
- name: Build and push image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./website | |
push: true | |
tags: ${{ steps.dockerMetadata.outputs.tags }} | |
labels: ${{ steps.dockerMetadata.outputs.labels }} | |
end2endTests: | |
name: End to End Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache yarn | |
uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('variation/**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn --immutable | |
- name: Start database | |
run: docker compose -f ../docker-compose.yml up -d database | |
- name: Copy production env file | |
run: cp .env.production.sample .env.production | |
- name: Build website | |
run: yarn build | |
env: | |
NODE_ENV: production | |
- name: Install pm2 | |
run: yarn global add pm2 | |
- name: Start website | |
run: pm2 start yarn --name website -- start | |
- name: Run tests | |
run: yarn e2e |