Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rominronin authored Jan 31, 2024
1 parent ee43eeb commit 4589a37
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This is a basic workflow to help you get started with using HydePHP with GitHub Actions

name: Build & Deploy

# Controls when the workflow will run
on:
# We only want to run this workflow when changes are pushed to the master/main branch
push:
branches: [ "master" ]

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

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# First we need to build the site
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v3

# (optional) Validate the Composer files to catch any errors early on
- name: Validate composer.json and composer.lock
run: composer validate --strict

# (optional) Cache the Composer packages to speed up future builds
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
# Install the Composer packages
- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Now we can build the site! We do this using the HydeCLI
- name: Build the site
run: php hyde build --no-interaction

# Our site is now compiled into the _site directory, so we'll upload it to an artifact to use in the next job
- name: Upload site artifact
uses: actions/upload-artifact@v3
with:
name: site
path: _site

0 comments on commit 4589a37

Please sign in to comment.