Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
artifact_name: ${{ steps.set_artifact_name.outputs.name }}
steps:
- name: Set current date as env variable
run: echo "DATE_NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
id: set_artifact_name
run: |
echo "DATE_NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
echo "name=dist-$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -58,3 +63,26 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

preview:
needs: build
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: ./dist
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.0
with:
publish-dir: './dist'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy Preview for PR #${{ github.event.number }}"
enable-pull-request-comment: true
enable-commit-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ npm start
```

See [github workflow](.github/workflows/deploy.yml) and [package.json](package.json) for more information.

TEST PR