Skip to content

Commit ccf847a

Browse files
initial features
0 parents  commit ccf847a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4481
-0
lines changed

.dockerignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Fly.io proxy files
2+
/.proxy
3+
4+
# Git
5+
.git/
6+
.gitignore
7+
8+
# Mix artifacts
9+
/_build/
10+
/deps/
11+
*.ez
12+
13+
# Local development
14+
.env
15+
.env.local
16+
17+
# Node
18+
/assets/node_modules/
19+
20+
# Documentation
21+
/doc/
22+
23+
# Test artifacts
24+
/cover/
25+
26+
# Static artifacts you may not want in container
27+
/priv/static/
28+
29+
# Ignore package tarball
30+
portfolio-*.tar
31+
32+
# Ignore assets that have already been built
33+
/priv/static/assets/
34+
35+
# IDEs
36+
.idea/
37+
.vscode/
38+
*.swp
39+
*.swo
40+
*~
41+
.DS_Store

.formatter.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
import_deps: [:ecto, :ecto_sql, :phoenix],
3+
subdirectories: ["priv/*/migrations"],
4+
plugins: [Phoenix.LiveView.HTMLFormatter],
5+
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
6+
]

.github/workflows/deploy.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Deploy to Fly.io
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
15+
services:
16+
postgres:
17+
image: postgres:16-alpine
18+
env:
19+
POSTGRES_USER: postgres
20+
POSTGRES_PASSWORD: postgres
21+
POSTGRES_DB: portfolio_test
22+
ports:
23+
- 5432:5432
24+
options: >-
25+
--health-cmd pg_isready
26+
--health-interval 10s
27+
--health-timeout 5s
28+
--health-retries 5
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Elixir
35+
uses: erlef/setup-beam@v1
36+
with:
37+
elixir-version: '1.18.4'
38+
otp-version: '26.2'
39+
40+
- name: Set up Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: '22'
44+
cache: 'npm'
45+
cache-dependency-path: assets/package-lock.json
46+
47+
- name: Cache Mix dependencies
48+
uses: actions/cache@v4
49+
with:
50+
path: |
51+
deps
52+
_build
53+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-mix-
56+
57+
- name: Install Mix dependencies
58+
run: mix deps.get
59+
60+
- name: Compile
61+
run: mix compile --warnings-as-errors
62+
63+
- name: Install Node dependencies
64+
working-directory: assets
65+
run: npm ci
66+
67+
- name: Build assets
68+
working-directory: assets
69+
run: node build.js
70+
71+
- name: Run tests
72+
run: mix test
73+
env:
74+
MIX_ENV: test
75+
POSTGRES_HOST: localhost
76+
POSTGRES_USER: postgres
77+
POSTGRES_PASSWORD: postgres
78+
POSTGRES_DB: portfolio_test
79+
80+
deploy:
81+
name: Deploy to Fly.io
82+
runs-on: ubuntu-latest
83+
needs: test
84+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
85+
86+
steps:
87+
- name: Checkout code
88+
uses: actions/checkout@v4
89+
90+
- name: Set up Fly.io CLI
91+
uses: superfly/flyctl-actions/setup-flyctl@master
92+
93+
- name: Deploy to Fly.io
94+
run: flyctl deploy --remote-only
95+
env:
96+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Temporary files, for example, from tests.
23+
/tmp/
24+
25+
# Ignore package tarball (built via "mix hex.build").
26+
portfolio-*.tar
27+
28+
# Ignore assets that are produced by build tools.
29+
/priv/static/assets/
30+
31+
# Ignore digested assets cache.
32+
/priv/static/cache_manifest.json
33+
34+
# In case you use Node.js/npm, you want to ignore these.
35+
npm-debug.log
36+
/assets/node_modules/
37+
/assets/package-lock.json
38+
39+
# Environment variables
40+
.env
41+
.env.local
42+
43+
# IDE
44+
.vscode/
45+
.idea/
46+
*.swp
47+
*.swo
48+
*~
49+
.DS_Store
50+
51+
# Fly.io
52+
.fly/
53+

0 commit comments

Comments
 (0)