Skip to content

Commit

Permalink
issue #21: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vivalareda committed Nov 23, 2023
1 parent 3d0bae3 commit c46a60b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/workflow-gh-pages-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,43 @@ on:
required: false
type: string
default: 'gh-pages'
secrets:
ENV:
required: false

permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
WORKING_DIR: ${{ inputs.working-dir }}
NODE_VERSION: ${{ inputs.node-version }}
PUBLISH_DIR: ${{ inputs.publish-dir }}
CACHE_DEPENDENCY_PATH: ${{ inputs.cache-dependency-path }}
PUBLISH_BRANCH: ${{ inputs.publish-branch }}

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
node-version: ${{ inputs.node-version }}
cache: npm
cache-dependency-path: ${{ env.CACHE_DEPENDENCY_PATH }}
cache-dependency-path: ${{ inputs.working-dir }}

- name: Set ENV
run: |
echo "${{ secrets.ENV }}" >> $GITHUB_ENV
- name: Install Dependencies
run: npm install
working-directory: ${{ env.WORKING_DIR }}
working-directory: ${{ inputs.working-dir }}

- name: Build
run: npm run build
working-directory: ${{ env.WORKING_DIR }}
working-directory: ${{ inputs.working-dir }}

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}
publish_branch: ${{ env.PUBLISH_BRANCH }}
publish_dir: ${{ inputs.publish-dir }}
publish_branch: ${{ inputs.publish-branch }}

0 comments on commit c46a60b

Please sign in to comment.