Skip to content

Commit

Permalink
Update gh-pages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hbons committed Mar 11, 2024
1 parent efa1307 commit 38e40bd
Showing 1 changed file with 43 additions and 19 deletions.
62 changes: 43 additions & 19 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,60 @@ name: Publish GitHub Pages

on:
push:
branches: [ main ]
branches: ["main"]
workflow_dispatch:

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

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
# Build job
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '16'

- name: Install dependencies
run: npm install

# Build so we can publish the dist/ folder
- name: Build font
run: npm run build

- name: Update gh-pages branch
run: |
rm .gitignore
git add dist/codicon.csv
git add dist/codicon.css
git add dist/codicon.html
git add dist/codicon.svg
git add dist/codicon.ttf
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git commit -m "chore: Update gh-pages to ${{ github.sha }}"
git checkout -b gh-pages
git push -u -f origin gh-pages
- name: Setup Pages
uses: actions/configure-pages@v4

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact

uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 38e40bd

Please sign in to comment.