generated from Seekra/repository-template
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
# Copyright 2026 Seekra
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
name: Deploy on production
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
deploy:
|
|
if: ${{ !github.event.release.prerelease && !github.event.release.draft }}
|
|
|
|
name: Deploy on production
|
|
|
|
runs-on: node-minio
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set alias
|
|
run: |
|
|
mc alias set minio "${{ vars.S3_PROD_URL }}" "${{ secrets.S3_PROD_ACCESS_KEY }}" "${{ secrets.S3_PROD_SECRET_KEY }}"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm install
|
|
|
|
- name: Run build
|
|
run: |
|
|
npm run build
|
|
|
|
- name: Upload assets to MinIO
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
BUCKET="${{ vars.S3_PROD_BUCKET_NAME }}"
|
|
BUILD_ID=$(date -u +%Y-%m-%d)-$(git rev-parse --short HEAD)
|
|
|
|
echo "Build ID: $BUILD_ID"
|
|
|
|
mkdir -p ./dist
|
|
|
|
mc cp --recursive ./dist/ "minio/$BUCKET/builds/$BUILD_ID"
|
|
echo "Copied files successfully" |