WIP: Build & Release
This commit is contained in:
49
.github/workflows/release-morska.yml
vendored
Normal file
49
.github/workflows/release-morska.yml
vendored
Normal 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'});
|
||||
|
||||
Reference in New Issue
Block a user