Skip to content

Commit da4c3a1

Browse files
authored
Merge pull request #13 from amfoss/develop
Initial Release
2 parents 8f5ee97 + ae7d211 commit da4c3a1

File tree

7 files changed

+60
-39
lines changed

7 files changed

+60
-39
lines changed

.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DATABASE_URL=
2+
SMTP_EMAIL=
3+
SMTP_PASSWORD=

.github/workflows/deploy.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/ghcr-deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Inspired from: https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-docker-images
2+
name: Create and publish Docker image to GHCR
3+
4+
# Configures this workflow to run every time a change is pushed to the branch called `release`.
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches: ['production']
9+
10+
jobs:
11+
build-and-push-image:
12+
runs-on: ubuntu-latest
13+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
14+
permissions:
15+
contents: read
16+
packages: write
17+
id-token: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
# Uses the `docker/login-action` action to log in to the Github Container Registry
24+
- name: Log in to the Container registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
# This step uses `docker/metadata-action` to extract tags and labels that will be applied to the specified image.
32+
# The `id` "meta" allows the output of this step to be referenced in a subsequent step.
33+
# The `images` value provides the base name for the tags and labels.
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ghcr.io/amfoss/amMentor-backend
39+
tags: |
40+
# set latest tag for master branch
41+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }},priority=2000
42+
type=schedule,pattern={{date 'YYYYMMDD'}}
43+
type=ref,event=tag
44+
type=ref,event=pr
45+
type=sha
46+
47+
# This step uses the `docker/build-push-action` action to build the image. If the build succeeds, it pushes the image to GitHub Packages.
48+
- name: Build and push Docker image
49+
id: push
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
push: true
54+
tags: ${{ steps.meta.outputs.tags }}
55+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ __pycache__/
77
# Virtual environment
88
venv/
99
.env
10-
.env.*
1110

1211
# VS Code or JetBrains IDEs
1312
.vscode/
@@ -37,4 +36,4 @@ dist/
3736
# Personal debug files or backups
3837
*.bak
3938
*.tmp
40-
txt.txt
39+
txt.txt

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@ RUN pip install --no-cache-dir -r requirements.txt
77

88
COPY . .
99

10-
COPY wait-for-postgres.sh /app/wait-for-postgres.sh
11-
RUN chmod +x /app/wait-for-postgres.sh
12-
13-
CMD ["/app/wait-for-postgres.sh", "db:5432", "--", "bash", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]
10+
CMD ["bash", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]

procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

wait-for-postgres.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)