Skip to content

Commit 9e45559

Browse files
Copilotmmcky
andcommitted
Replace nwtgck/actions-netlify@v3 with netlify-cli in CI workflow
Co-authored-by: mmcky <[email protected]>
1 parent a756d9d commit 9e45559

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,31 @@ jobs:
7878
with:
7979
name: execution-reports
8080
path: _build/html/reports
81+
- name: Install Netlify CLI
82+
shell: bash -l {0}
83+
run: npm install -g netlify-cli
8184
- name: Preview Deploy to Netlify
82-
uses: nwtgck/actions-netlify@v3
83-
with:
84-
publish-dir: '_build/html/'
85-
production-branch: main
86-
github-token: ${{ secrets.GITHUB_TOKEN }}
87-
deploy-message: "Preview Deploy from GitHub Actions"
85+
shell: bash -l {0}
86+
run: |
87+
if [ "${{ github.event_name }}" = "pull_request" ]; then
88+
netlify deploy \
89+
--dir _build/html/ \
90+
--site ${{ secrets.NETLIFY_SITE_ID }} \
91+
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
92+
--alias pr-${{ github.event.pull_request.number }} \
93+
--context deploy-preview \
94+
--message "Preview Deploy from GitHub Actions PR #${{ github.event.pull_request.number }} (commit: ${{ github.sha }})" \
95+
--json
96+
else
97+
netlify deploy \
98+
--dir _build/html/ \
99+
--site ${{ secrets.NETLIFY_SITE_ID }} \
100+
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
101+
--alias manual-${{ github.run_id }} \
102+
--context dev \
103+
--message "Manual Deploy from GitHub Actions (commit: ${{ github.sha }})" \
104+
--json
105+
fi
88106
env:
89107
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
90108
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

package.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)