Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Urmila05 authored Oct 10, 2023
0 parents commit e1468d2
Show file tree
Hide file tree
Showing 10 changed files with 1,308 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Site

on:
push:
branches: [ main ]
workflow_dispatch:
workflow_call:

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: FranzDiebold/github-env-vars-action@v2
- run: sh -c "$(curl -fsSL https://fastn.com/install.sh)"
- name: Build the pages with fastn
run: |
echo "Using '$CI_REPOSITORY_NAME_SLUG/' as the base while building"
# To deploy the website using GitHub Pages, use the below command
fastn build --base=/$CI_REPOSITORY_NAME/
# To deploy the website using Custom Domain, use the below command and comment
#out the above command when deploying through GitHub Pages
#fastn build --base=/
- name: copy CNAME if found
run: '(test -f CNAME && cp CNAME .build) || echo "CNAME does not exist, skipping step"'
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.build
18 changes: 18 additions & 0 deletions .github/workflows/refresh-content-on-heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Update Content On Heroku

on:
workflow_dispatch:
workflow_call:
env:
CARGO_TERM_COLOR: always

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Redeploy Heroku
id: redeploy_heroku
run: |
curl --location --request POST \
--url 'https://<heroku-app-name>.herokuapp.com/-/clear-cache/?package=main&all-dependencies=true'
36 changes: 36 additions & 0 deletions .github/workflows/rename.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Rename the project from template

on: [push]

jobs:
rename-project:
if: ${{ github.repository != 'fifthtry/fastn-template' && github.run_number == 1 }}
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# this fetches all history so that we can read each commit
fetch-depth: 0
ref: ${{ github.head_ref }}
- run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
shell: bash
- run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
shell: bash
- name: Rename the project
run: |
echo "Using '${{ env.REPOSITORY_NAME }}' and "${{ env.REPOSITORY_OWNER }}" to rename fastn package"
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' FASTN.ftd
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' index.ftd
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' fastn-typography.ftd
sed -i -e 's/<user_name>/${{ env.REPOSITORY_OWNER }}/g' -e 's/<repo_name>/${{ env.REPOSITORY_NAME }}/g' README.md
rm .github/workflows/rename.yml
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "✅ Ready to clone and code."
# commit_options: '--amend --no-edit'
push_options: --force
call-deploy-workflow:
permissions: write-all
needs: [ rename-project ]
uses: ./.github/workflows/deploy.yml
21 changes: 21 additions & 0 deletions .github/workflows/update-fastn-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update FASTN binary on Heroku

on:
workflow_dispatch:
workflow_call:
env:
CARGO_TERM_COLOR: always

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Redeploy Heroku
id: redeploy_heroku
run: |
curl --location --request DELETE \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.heroku+json; version=3' \
--header 'authorization: Bearer ${{ secrets.HEROKU_TOKEN }}' \
--url https://api.heroku.com/apps/${{ secrets.HEROKU_APP_NAME }}/dynos/web.1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.packages
.build
.DS_Store
.idea
26 changes: 26 additions & 0 deletions FASTN.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- import: fastn

-- fastn.package: <user_name>.github.io/<repo_name>

-- fastn.dependency: fastn-community.github.io/site-doc
-- fastn.dependency: fastn-community.github.io/code-block
-- fastn.dependency: fastn-community.github.io/footer
;; replace inter-font package name with font package name you want to create
;; typography document for:
-- fastn.dependency: fastn-community.github.io/inter-font

-- fastn.auto-import: fastn-community.github.io/site-doc
-- fastn.auto-import: fastn-community.github.io/code-block as cb



-- fastn.sitemap:


# Home: index.html

- fastn typography: fastn-typography/


# GitHub
url: https://github.com/<user_name>/<repo_name>
28 changes: 28 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2023, fastn-stack

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Welcome to your [FASTN site](https://fastn.io/)

FASTN <repo_name> Template Repo

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :--------------------- | :------------------------------------------------- |
| `fastn build` | FASTN builder installs all `FASTN` dependencies |
| `fastn serve` | Starts local dev server at available port`localhost:8000` |



## 👀 Want to learn more?

Feel free to check [our documentation](https://fastn.io/) or jump into our [FifthTry Discord server](https://discord.gg/bucrdvptYd).
Loading

0 comments on commit e1468d2

Please sign in to comment.