Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pnp/pnp.github.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Bernier committed Jun 3, 2024
2 parents fd673d3 + 828de56 commit 4f8898a
Show file tree
Hide file tree
Showing 23 changed files with 22,716 additions and 66 deletions.
13 changes: 7 additions & 6 deletions .github/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ const repoRoot = process.cwd();
console.log('Repo root:', repoRoot);

let dirPath;
if (process.argv.includes('--action')) {
// If the script is being run as a GitHub Actions workflow
dirPath = path.join(repoRoot, '../../');
console.log('Running as a GitHub Action');
console.log('Directory path:', dirPath);
} else {
if (process.argv.includes('--direct')) {
// If the script is being run locally
console.log('Running directly')
dirPath = path.join(repoRoot, './static/');
console.log('Directory path:', dirPath);
} else {
// If the script is being run as a GitHub Actions workflow
dirPath = '/home/runner/work/pnp.github.io/pnp.github.io/gh-pages';
console.log('Running as a GitHub Action');
console.log('Directory path:', dirPath);
}


Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)

Expand All @@ -27,7 +27,7 @@ jobs:
run: hugo

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
84 changes: 42 additions & 42 deletions .github/workflows/update-ics.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
name: Update Calendar Files
name: Update ICAL Files

on:
workflow_dispatch:
push:
branches:
- main # Trigger on push to main, or adjust as needed
schedule:
- cron: '0 */4 * * *' # Adjust the schedule as necessary
workflow_run:
workflows: ["Deploy Hugo Site"]
types:
- completed

- cron: '0 12 * * *' # Optionally, schedule to run daily

jobs:
update-and-push:
update-ical:
name: Get ICS and Process
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages # Specify to checkout the gh-pages branch
path: gh-pages

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install
working-directory: .github/scripts

- name: Run script to update calendar files
run: npm start --action
working-directory: .github/scripts
env:
ICS_URL: ${{ secrets.ICS_URL }}

- name: Commit and push if there are changes
run: |
cd gh-pages
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add calendar.ics ical/calendar.json
git commit -m "Update calendar files" -a || echo "No changes to commit"
git push origin gh-pages

- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main # Specify the branch to checkout
path: main

- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages # Specify the branch to checkout
path: gh-pages

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '14' # Specify your Node.js version

- name: Install dependencies
run: npm install # Assuming your script needs npm packages
working-directory: ./main/.github/scripts

- name: Update ICAL File
run: node index.js --action # Run your specific script
working-directory: ./main/.github/scripts

- name: Commit and push if there are changes
run: |
cd gh-pages
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add calendar.ics ical/calendar.json
git commit -m "Update calendar files" -a || echo "No changes to commit"
git push origin gh-pages
7 changes: 7 additions & 0 deletions content/extensions/pnp-ps-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: PnP PowerShell extension
description: >
Boost your productivity when creating scripts that use PnP PowerShell. Embedded docs, samples gallery, code snippets, and more.
image: images/extensions-background-pnp-ps.webp
externalLink: "https://marketplace.visualstudio.com/items?itemName=adamwojcikit.pnp-powershell-extension"
---
Binary file added static/images/extensions-background-pnp-ps.webp
Binary file not shown.
Loading

0 comments on commit 4f8898a

Please sign in to comment.