WIP: Build & Release

This commit is contained in:
Michał Zieliński
2025-02-12 15:39:32 +01:00
parent 8e4312f0dd
commit b5c5bf08d2
5 changed files with 89 additions and 58 deletions

49
.github/workflows/release-morska.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
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'});