-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
64 additions
and
157 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.