Skip to content

update ci/cd

update ci/cd #364

Workflow file for this run

name: CI/CD
on: push
permissions:
contents: read
packages: write
jobs:
format-build-test-and-e2e:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci --ignore-scripts --no-audit
- run: npm run format:check
- run: npm run build:client --workspace=@digital-garden/blog
- run: npm run build:server --workspace=@digital-garden/blog
- run: npm run test --workspace=@digital-garden/blog
- run: npm run e2e:setup --workspace=@digital-garden/blog -- --with-deps
- run: npm run e2e --workspace=@digital-garden/blog
- uses: actions/upload-artifact@v4
with:
name: playwright-report
path: ./packages/blog/playwright-report/
retention-days: 30
build-and-push:
runs-on: ubuntu-latest
needs: format-build-test-and-e2e
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: extract-version
run: echo "VERSION=$(jq -r .version < package.json)" >> $GITHUB_OUTPUT
- uses: docker/build-push-action@v5
with:
context: .
file: ./packages/blog/Dockerfile
push: true
tags: ghcr.io/vorant94/digital-garden-blog:${{ steps.extract-version.outputs.VERSION }}