Skip to content

Commit

Permalink
feat: add staging deployment workflow with Netlify integration
Browse files Browse the repository at this point in the history
  • Loading branch information
amalv committed Jan 7, 2024
1 parent 0be4e39 commit 7912c2b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and Deploy to Netlify
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: "./dist"
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_run:
workflows: ["Build and Deploy to Netlify"]
types:
- completed

jobs:
unit-tests:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,6 +25,7 @@ jobs:

e2e-tests:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down

0 comments on commit 7912c2b

Please sign in to comment.