Skip to content

Commit

Permalink
Simplify the CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kafeman committed Dec 3, 2024
1 parent 372cc2a commit f7da81c
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 157 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/build.yaml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
on:
push:
paths-ignore:
- '**/README.md'
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
- name: Make sure there are no type checking errors
run: npx tsc --noEmit
- run: npm run build
env:
NODE_ENV: production
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
deploy_staging:
name: Staging
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- run: |
mkdir ~/.ssh
echo "${{ vars.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
eval `ssh-agent`
echo "$SSH_PRIVATE_KEY" | ssh-add -
rsync --recursive --verbose dist/ [email protected]:/var/www/beta.habrasanta.org
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Smoke test
run: curl --fail https://beta.habrasanta.org
deploy_production:
name: Production
needs: deploy_staging
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- run: |
mkdir ~/.ssh
echo "${{ vars.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
eval `ssh-agent`
echo "$SSH_PRIVATE_KEY" | ssh-add -
rsync --recursive --verbose dist/ [email protected]:/var/www/habra-adm.ru
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Smoke test
run: curl --fail https://habra-adm.ru
44 changes: 0 additions & 44 deletions .github/workflows/deploy.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/lint.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/main.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/pull-request-cleanup.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/pull-request.yaml

This file was deleted.

0 comments on commit f7da81c

Please sign in to comment.