Skip to content

Commit

Permalink
Merge branch 'octomind-e2e-integration-workflow-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakbar-deriv committed Jan 8, 2025
2 parents fd98876 + aab860c commit 8a54020
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: npm test -- --coverage

- name: Cache build validation
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-prod-build-${{ github.sha }}
Expand All @@ -81,10 +81,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
Expand All @@ -99,20 +99,20 @@ jobs:
NODE_ENV: production

- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v3

- name: Create Deployment Status
if: always()
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
Expand All @@ -132,7 +132,7 @@ jobs:
- name: Notify on Failure
if: failure()
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
Expand Down Expand Up @@ -58,10 +58,10 @@ jobs:

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

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
Expand All @@ -75,27 +75,40 @@ jobs:
VITE_APP_ENV: preview

- name: Cache build output
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-build-${{ github.sha }}

- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: './dist'

- name: Deploy PR Preview
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v3
with:
preview: true

- name: Handle Deploy Failure
if: failure() && steps.deployment.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ Preview deployment failed. Check the workflow logs for details.'
});
core.setFailed('Preview deployment failed');
- name: Comment PR
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const url = `${{ steps.deployment.outputs.page_url }}`;
Expand Down Expand Up @@ -129,7 +142,7 @@ jobs:

- name: Report Workflow Status
if: always()
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
Expand Down

0 comments on commit 8a54020

Please sign in to comment.