Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RafikHamza authored Oct 8, 2024
1 parent ddf5555 commit 5bbebfb
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: Deploy Svelte App to GitHub Pages

on:
push:
branches:
- main # Triggers the workflow on any push to the main branch

jobs:
build:
runs-on: ubuntu-latest # The environment on which the job will run

steps:
- name: Checkout repository
uses: actions/checkout@v2 # Check out the code from the repository

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16' # Set the Node.js version

- name: Install dependencies
run: npm install # Install the necessary dependencies from package.json

- name: Build the Svelte app
run: npm run build # Run the build script to create a production version of your Svelte app

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3 # Use this action to deploy the site to GitHub Pages
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Access GitHub's token to deploy
publish_dir: ./public # The directory containing the production build (Svelte's output is usually in 'public')

0 comments on commit 5bbebfb

Please sign in to comment.