Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/improvements #508

Merged
merged 5 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
packages: write
id-token: write
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,40 @@ jobs:
VERSION=${{ needs.release.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max

mirror:
runs-on: ubuntu-latest
needs:
- release
- publish
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: 'us-east-1'
- uses: docker/login-action@v2
with:
registry: public.ecr.aws
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: akhilerm/[email protected]
with:
src: docker.io/supabase/storage-api:${{ needs.release.outputs.version }}
dst: |
public.ecr.aws/supabase/storage-api:latest
docker.io/supabase/storage-api:latest
ghcr.io/supabase/storage-api:latest

17 changes: 17 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { build } = require('esbuild')

build({
entryPoints: ['./src/**/*.ts'],
bundle: false,
outdir: 'dist',
platform: 'node',
format: 'cjs',
target: 'node20',
sourcemap: true,
tsconfig: 'tsconfig.json',
loader: { '.ts': 'ts' },
}).catch((e) => {
console.error(e)
process.exit(1)
})
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ module.exports = {
transform: {
'^.+\\.(t|j)sx?$': 'ts-jest',
},
moduleNameMapper: {
'^@storage/(.*)$': '<rootDir>/src/storage/$1',
'^@internal/(.*)$': '<rootDir>/src/internal/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testEnvironment: 'node',
testPathIgnorePatterns: ['node_modules', 'dist'],
Expand Down
Loading
Loading