Skip to content

Commit

Permalink
Setup: Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
antidoid committed Jan 30, 2024
1 parent 5f9180b commit 27c33c4
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM jetpackio/devbox:latest

# Installing your devbox project
WORKDIR /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock



RUN devbox run -- echo "Installed Packages."

RUN devbox shellenv --init-hook >> ~/.profile
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Devbox Remote Container",
"build": {
"dockerfile": "./Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"jetpack-io.devbox"
]
}
},
"remoteUser": "devbox"
}
59 changes: 59 additions & 0 deletions .github/workflows/deploy-webpage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy to GH Pages

on:
push:
branches:
- main
paths:
- "frontend/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"

- name: Install Dependencies and Build
run: "cd ./frontend && npm install && npm run build"
env:
VITE_FUNCTION_URL: ${{ secrets.VITE_FUNCTION_URL }}

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
name: frontend-dist # Set a name for the artifact
path: "./frontend/dist" # Upload the dist directory within /frontend

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
with:
artifact_name: frontend-dist

0 comments on commit 27c33c4

Please sign in to comment.