-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
3e8e38f
commit e6194f3
Showing
1 changed file
with
8 additions
and
37 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -17,12 +17,13 @@ jobs: | |
build: | ||
name: Build static files | ||
runs-on: ubuntu-latest | ||
environment: ${{ github.event.inputs.environment || 'staging' }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure environment variables | ||
run: echo "${{ secrets.ENV_VARIABLES }}" > .env.local | ||
run: echo "${{ vars.ENV_VARIABLES }}" > .env.local | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
@@ -52,46 +53,16 @@ jobs: | |
path: dist/ | ||
if-no-files-found: error | ||
|
||
deploy-staging: | ||
if: github.repository_owner == 'one-zero-eight' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging') || (github.event_name == 'push' && github.ref == 'refs/heads/main')) | ||
name: Deploy to staging server | ||
deploy: | ||
if: github.repository_owner == 'one-zero-eight' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production') || (github.event_name == 'push' && github.ref == 'refs/heads/main')) | ||
name: Deploy to server for ${{ github.event.inputs.environment || 'staging' }} | ||
needs: build | ||
runs-on: self-hosted | ||
environment: | ||
name: staging | ||
url: https://pre.innohassle.ru | ||
name: ${{ github.event.inputs.environment || 'staging' }} | ||
url: ${{ vars.DEPLOY_URL }} | ||
concurrency: | ||
group: staging | ||
cancel-in-progress: false | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: static-files | ||
path: dist | ||
|
||
- name: Copy files via SSH | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
fingerprint: ${{ secrets.SSH_FINGERPRINT }} | ||
source: "./dist/*" | ||
target: ${{ secrets.SSH_TARGET_DIR }} | ||
strip_components: 1 | ||
overwrite: true | ||
rm: true | ||
|
||
deploy-production: | ||
if: github.repository_owner == 'one-zero-eight' && (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production') | ||
name: Deploy to production server | ||
needs: build | ||
runs-on: self-hosted | ||
environment: | ||
name: production | ||
url: https://innohassle.ru | ||
concurrency: | ||
group: production | ||
group: ${{ github.event.inputs.environment || 'staging' }} | ||
cancel-in-progress: false | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|