Skip to content

Commit

Permalink
Merge branch 'master' into blog
Browse files Browse the repository at this point in the history
  • Loading branch information
rtshkmr committed Aug 19, 2024
2 parents bdd5f11 + 38c0b8b commit 46c4e19
Show file tree
Hide file tree
Showing 78 changed files with 5,312 additions and 2,033 deletions.
70 changes: 38 additions & 32 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ on:

jobs:
test:

name: Build and Run Mix Test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04 # Use a specific version for stability
name: Build OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} && Run Mix Test
services:
postgres:
image: postgres:latest
Expand All @@ -18,48 +17,55 @@ jobs:
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
otp: ['26.2']
elixir: ['1.16.3']
steps:
- uses: actions/checkout@v2
- name: Install dependecies for build
run: sudo apt-get install -y libncurses-dev libtinfo5
- name: Set up Elixir
uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
elixir-version: '1.15.7' # Define the elixir version [required]
otp-version: '25' # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
working-directory: ./
run: mix deps.get
- name: Run tests
env:
# use localhost for the host here because we are running the job on the VM.
# If we were running the job on in a container this would be postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
working-directory: ./
run: mix test
- name: Checkout code
uses: actions/checkout@v4 # Pin to a specific version for stability

- name: Install dependencies for build
run: sudo apt-get update && sudo apt-get install -y libncurses-dev libtinfo5

- name: Setup Elixir and OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}

- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Install dependencies
run: mix deps.get

- name: Run tests
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
run: mix test

deploy:
needs: test
name: Build & Deploy to Fly
runs-on: ubuntu-latest
runs-on: ubuntu-22.04 # Use a specific version for stability

steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions@master
- name: Checkout code
uses: actions/checkout@v4 # Pin to a specific version for stability

- name: Deploy to Fly.io
uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_APP: vyasa
Expand Down
51 changes: 51 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,54 @@
.emphasized-verse {
@apply bg-brandAccentLight border-b-0 border-l-8 border-black p-4 pl-8 rounded-sm;
}

@font-face {
font-family: "et-book";
src: url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot");
src: url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf") format("truetype"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.svg#etbookromanosf") format("svg");
font-weight: normal;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "et-book";
src: url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot");
src: url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf") format("truetype"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg#etbookromanosf") format("svg");
font-weight: normal;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: "et-book";
src: url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot");
src: url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf") format("truetype"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.svg#etbookromanosf") format("svg");
font-weight: bold;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "et-book-roman-old-style";
src: url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot");
src: url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf") format("truetype"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg#etbookromanosf") format("svg");
font-weight: normal;
font-style: normal;
font-display: swap;
}
/* This file is for your main application CSS */

.hoverune,
.marginote {
float: right;
clear: right;
margin-right: -60%;
width: 50%;
margin-top: 0.3rem;
margin-bottom: 0;
font-size: 1.1rem;
line-height: 1.3;
vertical-align: baseline;
position: relative;
}
9 changes: 9 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,20 @@ let liveSocket = new LiveSocket("/live", Socket, {
hooks: Hooks,
});


// Show progress bar on live navigation and form submits
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" });
window.addEventListener("phx:page-loading-start", (_info) => topbar.show(300));
window.addEventListener("phx:page-loading-stop", (_info) => topbar.hide());

// Stream our server logs directly to our browser’s console
window.addEventListener("phx:live_reload:attached", ({detail: reloader}) => {
// enable server log streaming to client.
// disable with reloader.disableServerLogs()
reloader.enableServerLogs()

})

// connect if there are any LiveViews on the page
liveSocket.connect();

Expand Down
15 changes: 15 additions & 0 deletions assets/js/hooks/apply_modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const ApplyModal = () => {
const modal = document.querySelector('[data-selector="vyasa_modal_message"]')

if (!modal) return

const encodedReturnTo = encodeURIComponent(document.location.pathname)

modal.querySelectorAll('a[data-phx-link="redirect"]').forEach(val => {
const url = new URL(val.href, document.location.origin)
url.searchParams.set('return_to', encodedReturnTo)
val.href = `${url.href}`
})
}

export default ApplyModal
Loading

0 comments on commit 46c4e19

Please sign in to comment.