Skip to content

Commit

Permalink
Merge pull request #1 from Travelopia/add/deployment-workflow
Browse files Browse the repository at this point in the history
Add deployment workflow
  • Loading branch information
actuallyakash authored Jul 4, 2024
2 parents 82f6c38 + 844a6bd commit 5b94b87
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 110 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 80
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

[*.js]
quote_type = single

[*.{yml,yaml}]
indent_style = space
indent_size = 2
70 changes: 70 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: GitHub Pages Deployment

on:
workflow_dispatch:
push:
branches:
- main

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false # Let all the deployments go through.

jobs:
build:
runs-on: ubuntu-latest
permissions:
pages: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7

- name: Configure Node.js cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
id: node-npm-cache
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: "5"
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}

- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
with:
node-version-file: ".nvmrc"

- name: Install dependencies
if: ${{ steps.node-npm-cache.outputs.cache-hit != 'true' }}
run: npm ci

- name: Build website
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b #v5.0.0

- name: Upload build artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1
with:
name: handbook-build
path: ./dist

deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
contents: read
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5
with:
artifact_name: handbook-build
19 changes: 0 additions & 19 deletions index.html

This file was deleted.

Loading

0 comments on commit 5b94b87

Please sign in to comment.