chore: update pr title checker action to v1.4 #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Deploy' | |
on: | |
push: | |
branches: [main, develop] | |
concurrency: | |
group: ${{ github.ref }} | |
jobs: | |
lint-and-test: | |
name: Lint and unit test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ${{ github.ref }} branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 7.0.1 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16.13.0 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Run lint, type checks and tests | |
run: | | |
pnpm concurrently -g \ | |
"pnpm lint" \ | |
"pnpm check:types" \ | |
"pnpm test -- --maxWorkers=4 --no-color --coverage=false --changedSince=origin/main" | |
deploy-to-dev: | |
name: Deploy to Dev | |
if: github.event.ref == 'refs/heads/develop' | |
needs: lint-and-test | |
uses: ./.github/workflows/deploy-action.yml | |
with: | |
environment: dev | |
branch: develop | |
secrets: | |
ssh_host: ${{ secrets.SSH_HOST }} | |
ssh_user: ${{ secrets.SSH_USER }} | |
ssh_key_ed25519: ${{ secrets.SSH_KEY_ED25519 }} | |
ssh_port: ${{ secrets.SSH_PORT }} | |
release: | |
name: Release | |
if: github.event.ref == 'refs/heads/main' | |
needs: lint-and-test | |
runs-on: ubuntu-latest | |
outputs: | |
skipped: ${{ steps.changelog.outputs.skipped }} | |
tag: ${{ steps.changelog.outputs.tag }} | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
token: ${{ secrets.PAT }} | |
- id: changelog | |
name: Conventional Changelog | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
git-message: 'chore(release): {version} [no ci]' | |
git-user-email: [email protected] | |
git-user-name: Emmanuel Nipal | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
output-file: 'false' | |
- name: Create Github Release | |
uses: actions/create-release@v1 | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.changelog.outputs.tag }} | |
release_name: ${{ steps.changelog.outputs.tag }} | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
deploy-to-staging: | |
name: Deploy to Staging | |
if: needs.release.outputs.skipped == 'false' | |
needs: release | |
uses: ./.github/workflows/deploy-action.yml | |
with: | |
environment: staging | |
branch: 'refs/tags/${{needs.release.outputs.tag}}' | |
secrets: | |
ssh_host: ${{ secrets.SSH_HOST }} | |
ssh_user: ${{ secrets.SSH_USER }} | |
ssh_key_ed25519: ${{ secrets.SSH_KEY_ED25519 }} | |
ssh_port: ${{ secrets.SSH_PORT }} |