Files
DiunaBI/.github/workflows/release-morska.yml
Michał Zieliński cf9a4b2c77 WIP: Build & Release
2025-02-12 15:43:31 +01:00

51 lines
1.8 KiB
YAML

name: Morska Release
on:
workflow_dispatch:
inputs:
job_id:
description: 'Job ID of the build to release'
required: false
permissions:
actions: read
contents: read
jobs:
release:
runs-on: ubuntu-latest
environment: Morska
steps:
- uses: actions/checkout@v3
- name: Assign run ID if provided
if: ${{ github.event.inputs.job_id != '' }}
run: echo "job_id=${{ github.event.inputs.job_id }}" >> $GITHUB_ENV
- name: Get last build ID
id: get-build-id
if: ${{ github.event.inputs.job_id == '' }}
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/workflows/buildScripts/getLastBuildId.js');
const jobId = await script({github, context});
core.setOutput("job_id", jobId);
- name: Set job_id
if: ${{ github.event.inputs.job_id == '' }}
run: echo "job_id=${{ steps.get-build-id.outputs.job_id }}" >> $GITHUB_ENV
- name: Download frontend artifacts
if: ${{ github.event.inputs.job_id == '' }}
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/workflows/buildScripts/downloadArtifacts.js');
await script({github, context, core, jobId: ${{env.job_id}}, name: 'frontend'});
- name: Download backend artifacts
if: ${{ github.event.inputs.job_id == '' }}
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/workflows/buildScripts/downloadArtifacts.js');
await script({github, context, core, jobId: ${{env.job_id}}, name: 'webapi'});
- name: List artifacts
run: ls -la ./${{env.job_id}}