Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dudushy committed Oct 7, 2024
1 parent 20d3bf9 commit f5cebf7
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

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

Expand All @@ -24,9 +24,6 @@ concurrency:
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -47,15 +44,22 @@ jobs:
- name: Build
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v5
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist build directory
path: "./dist/${{ github.event.repository.name }}/browser/"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Commit and Push to gh-pages branch
run: |
# Create a new directory to store compiled output
mkdir gh-pages
# Copy build output to the new directory
cp -r ./dist/* gh-pages/
# Initialize a new git repo in the gh-pages directory
cd gh-pages
git init
git checkout -b gh-pages
git add .
git commit -m "Deploy updated static content"
# Force push to the gh-pages branch of the repository
git push --force "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages:gh-pages

0 comments on commit f5cebf7

Please sign in to comment.