Skip to content

Commit

Permalink
ci: conditionally run deploy jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron de las Alas committed Nov 14, 2023
1 parent 6b5c015 commit 9282eea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push: # Runs whenever a commit is pushed to the repository

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }}"
cancel-in-progress: true

permissions:
Expand All @@ -14,18 +14,18 @@ permissions:
issues: write # comment on released issues
pull-requests: write # comment on released pull requests


jobs:
setup:
runs-on: ubuntu-latest
env:
TRIGGER_DEPLOY: ${{ startsWith(github.ref, 'refs/heads/master') }}
env:
DETECT_CHROMEDRIVER_VERSION: "true"
JEST_JUNIT_OUTPUT_DIR: test-results
NODE_OPTIONS: --max-old-space-size=4000
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v5
if: github.event_name == 'pull_request'
if: github.ref_name == 'develop'
- uses: actions/setup-node@v3
with:
cache: "npm"
Expand Down Expand Up @@ -184,6 +184,7 @@ jobs:
path: ./test-results/*
deploy-npm:
needs: [test-integration, test-unit]
if: ${{ github.ref_name != 'develop'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -204,12 +205,14 @@ jobs:
sed -e "s|hotfix/REPLACE|${{ github.ref_name }}|" --in-place release.config.js
fi
- name: Semantic Release

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx --no -- semantic-release
deploy-gh-pages:
needs: [test-integration, test-unit]
if: ${{ github.ref_name != 'develop'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -226,6 +229,7 @@ jobs:
./build
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
- name: Deploy playground to GitHub Pages

uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily-tx-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# with:
# ref: 'develop'
with:
ref: 'develop'
- uses: actions/setup-node@v3
with:
cache: 'npm'
Expand Down

0 comments on commit 9282eea

Please sign in to comment.