Skip to content

Commit

Permalink
Alternative flow to build
Browse files Browse the repository at this point in the history
  • Loading branch information
jlurena committed Nov 24, 2023
1 parent b01ba34 commit f4d6120
Showing 1 changed file with 17 additions and 33 deletions.
50 changes: 17 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
name: Build and Deploy
name: Build Website

on:
workflow_dispatch:
push:
branches: main
concurrency:
group: pages
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Build
if: ${{ github.head_ref == 'main' }}
name: Build gh-page
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: refs/heads/${{ github.head_ref }}
- name: Install NodeJS
uses: actions/setup-node@v3
with:
Expand All @@ -29,23 +21,15 @@ jobs:
run: npm install --omit=dev
- name: Build
run: npm run build
- name: Configure server filepath
run: >
mkdir /tmp/source_rm &&
mv * /tmp/source_rm &&
mv /tmp/source_rm/build public &&
mv public/index.html . &&
rm -r /tmp/source_rm
- name: debug
run: ls
- name: debug2
run: ls public
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "build" || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-page
force: true

0 comments on commit f4d6120

Please sign in to comment.