Skip to content

Dev Deploy to by @rosado #12

Dev Deploy to by @rosado

Dev Deploy to by @rosado #12

Workflow file for this run

name: Deploy To Development
run-name: Dev Deploy to ${{ inputs.environment }} by @${{ github.actor }}
on:
push:
branches:
- rosado/ci_cd_v2
workflow_dispatch:
inputs:
environment:
type: environment
description: The environment to deploy to.
jobs:
test:
uses: ./.github/workflows/test.yml
with:
environment: '${{ inputs.environment }}'
secrets: inherit
detect-environments:
runs-on: ubuntu-latest
needs: [test]
outputs:
environments: ${{ steps.environments.outputs.result }}
#if: github.ref_name == ''
steps:
- uses: actions/github-script@v6
id: environments
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: json
script: |
if (context.payload?.inputs?.environment) return [context.payload?.inputs?.environment];
const {data: {environments}} =
await github.request(`GET /repos/${process.env.GITHUB_REPOSITORY}/environments`);
return environments.map(e => e.name)