fix: handle random path prefix for cache service v1 routes #209
This file contains hidden or 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/CD | |
on: | |
workflow_dispatch: | |
push: | |
branches: '**' | |
pull_request: | |
branches: | |
- dev | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: 💅 Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: pnpm install | |
uses: falcondev-it/.github/actions/pnpm-install@master | |
- name: Cache ESLint & Prettier | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.eslintcache | |
node_modules/.cache/prettier/.prettier-cache | |
key: eslint-prettier-cache-${{ runner.os }} | |
- run: pnpm run lint:ci | |
type-check: | |
name: 🛃 Type Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: pnpm install | |
uses: falcondev-it/.github/actions/pnpm-install@master | |
- run: pnpm run type-check | |
test-unit: | |
name: 🧪 Unit Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
storage-driver: [filesystem, s3, gcs] | |
db-driver: [postgres, mysql, sqlite] | |
steps: | |
- name: pnpm install | |
uses: falcondev-it/.github/actions/pnpm-install@master | |
- run: touch mock.key | |
- run: touch mock.crt | |
- run: pnpm run test:run | |
env: | |
VITEST_DB_DRIVER: ${{ matrix.db-driver }} | |
VITEST_STORAGE_DRIVER: ${{ matrix.storage-driver }} | |
DISABLE_PROXY: true | |
CA_CERT_PATH: mock.crt | |
CA_KEY_PATH: mock.key | |
deploy: | |
if: github.event.ref == 'refs/heads/dev' | |
name: 🚀 Build and push | |
permissions: | |
packages: write | |
contents: read | |
needs: [lint, type-check, test-unit] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: dev | |
- name: Get build hash | |
id: build_hash | |
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/falcondev-oss/github-actions-cache-server | |
tags: | | |
dev | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
BUILD_HASH=${{ steps.build_hash.outputs.COMMIT_SHA }} |