Skip to content

Commit ac110bb

Browse files
committed
feat: initial upload
0 parents  commit ac110bb

1,698 files changed

Lines changed: 8953313 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Trigger auto deployment for addressdata-app
2+
3+
# When this action will be executed
4+
on:
5+
# Automatically trigger it when detected changes in repo
6+
push:
7+
branches:
8+
[ main ]
9+
paths:
10+
- '**'
11+
- '.github/workflows/addressdata-app-AutoDeployTrigger-1352a65f-b8b9-449e-a5dd-c191984e6a8c.yml'
12+
13+
# Allow manual trigger
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
id-token: write #This is required for requesting the OIDC JWT Token
21+
contents: read #Required when GH token is used to authenticate with private repo
22+
23+
steps:
24+
- name: Checkout to the branch
25+
uses: actions/checkout@v2
26+
27+
- name: Azure Login
28+
uses: azure/login@v1
29+
with:
30+
client-id: ${{ secrets.ADDRESSDATAAPP_AZURE_CLIENT_ID }}
31+
tenant-id: ${{ secrets.ADDRESSDATAAPP_AZURE_TENANT_ID }}
32+
subscription-id: ${{ secrets.ADDRESSDATAAPP_AZURE_SUBSCRIPTION_ID }}
33+
34+
- name: Build and push container image to registry
35+
uses: azure/container-apps-deploy-action@v2
36+
with:
37+
appSourcePath: ${{ github.workspace }}/src
38+
_dockerfilePathKey_: _dockerfilePath_
39+
registryUrl: containerplace.azurecr.io
40+
registryUsername: ${{ secrets.ADDRESSDATAAPP_REGISTRY_USERNAME }}
41+
registryPassword: ${{ secrets.ADDRESSDATAAPP_REGISTRY_PASSWORD }}
42+
containerAppName: addressdata-app
43+
resourceGroup: addressdata-rg
44+
imageToBuild: containerplace.azurecr.io/addressdata-app:${{ github.sha }}
45+
_buildArgumentsKey_: |
46+
_buildArgumentsValues_
47+
48+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
databases
3+
performance-improvement

readme.md

Whitespace-only changes.

run.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cd src
2+
echo "Starting on localhost:8001. It may take a bit of time..."
3+
docker run -p 8001:8001 -it $(docker build -q .)

src/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Build image
2+
FROM mcr.microsoft.com/powershell AS build-image
3+
# 1. Install dependencies on build image
4+
RUN apt update -y
5+
RUN apt install python3-pip -y
6+
RUN pip3 install sqlite-utils
7+
# 2. Initialize databases for datasette from csv
8+
WORKDIR build
9+
COPY . .
10+
RUN pwsh ./initialize-databases.ps1
11+
# 3. Cleanup, we don't need csv folder anymore
12+
RUN rm -r csv
13+
14+
# Final image
15+
FROM datasetteproject/datasette:0.65.1 AS final-image
16+
# 3. Install dependencies on final image
17+
RUN pip install datasette-cluster-map
18+
# 4. Copy files over from build image
19+
WORKDIR app
20+
COPY --from=build-image build .
21+
# 5. Run it
22+
RUN chmod +x run-entrypoint.sh
23+
EXPOSE 8001
24+
ENTRYPOINT ["./run-entrypoint.sh"]

0 commit comments

Comments
 (0)