Skip to content

Commit c38452f

Browse files
committed
Add synapse-s3-storage-provider
1 parent 9c2e6d4 commit c38452f

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: main
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
branches:
8+
- main
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
main:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v1
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v1
24+
- name: Log in to the Container registry
25+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
- name: Run Buildx
36+
run: |
37+
docker buildx build \
38+
--push \
39+
--platform=linux/amd64,linux/arm64,linux/armhf \
40+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest -f ./Dockerfile ./
41+
- name: Also create tagged image if tag exists
42+
if: startsWith(github.ref, 'refs/tags/')
43+
run: |
44+
TAG=${GITHUB_REF#refs/tags/}
45+
docker buildx build \
46+
--push \
47+
--platform=linux/amd64,linux/arm64,linux/armhf \
48+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG -f ./Dockerfile ./

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3.9-slim-buster AS build
2+
3+
RUN apt-get update && apt-get install -y git
4+
5+
WORKDIR /app
6+
7+
# Download the S3 Storage Provider module
8+
RUN git clone https://github.com/matrix-org/synapse-s3-storage-provider.git
9+
10+
FROM matrixdotorg/synapse:latest AS runtime
11+
12+
# Copy the s3_storage_provider.py into the RUN image
13+
COPY --from=build /app/synapse-s3-storage-provider/s3_storage_provider.py /usr/local/lib/python3.9/site-packages/
14+

0 commit comments

Comments
 (0)