Skip to content

Commit

Permalink
chore: add manual trigger
Browse files Browse the repository at this point in the history
need two commit messages
  • Loading branch information
thegentlemanphysicist committed Feb 3, 2023
1 parent 3397684 commit debd0b6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/publish-aggregator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
- aggregator/**
- helm/aggregator/**
- .github/workflows/publish-aggregator.yml
workflow_dispatch:
inputs:
environment:
description: The target environment
required: true
options: [sandbox, production]

env:
GITHUB_REGISTRY: ghcr.io
Expand Down Expand Up @@ -53,7 +59,9 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

- name: Set env to Sandbox
if: (github.ref == 'refs/heads/dev' && github.event_name == 'push')
if: |
(github.ref == 'refs/heads/dev' && github.event_name == 'push') ||
(github.event.inputs.environment == 'sandbox' && github.event_name == 'workflow_dispatch')
run: |
cat >> $GITHUB_ENV <<EOF
OPENSHIFT_TOKEN=${{ secrets.SANDBOX_OPENSHIFT_TOKEN }}
Expand All @@ -62,7 +70,9 @@ jobs:
EOF
- name: Set env to Production
if: (github.ref == 'refs/heads/main' && github.event_name == 'push')
if: |
(github.ref == 'refs/heads/main' && github.event_name == 'push') ||
(github.event.inputs.environment == 'production' && github.event_name == 'workflow_dispatch')
run: |
cat >> $GITHUB_ENV <<EOF
OPENSHIFT_TOKEN=${{ secrets.PROD_OPENSHIFT_TOKEN }}
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/publish-grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:
paths:
- helm/grafana/**
- .github/workflows/publish-grafana.yml

workflow_dispatch:
inputs:
environment:
description: The target environment
required: true
options: [sandbox, production]
jobs:
build-and-push-image:
runs-on: ubuntu-22.04
Expand All @@ -23,7 +28,9 @@ jobs:
uses: ./.github/actions/setup-tools

- name: Set env to Sandbox
if: (github.ref == 'refs/heads/dev' && github.event_name == 'push')
if: |
(github.ref == 'refs/heads/dev' && github.event_name == 'push') ||
(github.event.inputs.environment == 'sandbox' && github.event_name == 'workflow_dispatch')
run: |
cat >> $GITHUB_ENV <<EOF
OPENSHIFT_TOKEN=${{ secrets.SANDBOX_OPENSHIFT_TOKEN }}
Expand All @@ -34,7 +41,9 @@ jobs:
EOF
- name: Set env to Production
if: (github.ref == 'refs/heads/main' && github.event_name == 'push')
if: |
(github.ref == 'refs/heads/main' && github.event_name == 'push') ||
(github.event.inputs.environment == 'production' && github.event_name == 'workflow_dispatch')
run: |
cat >> $GITHUB_ENV <<EOF
OPENSHIFT_TOKEN=${{ secrets.PROD_OPENSHIFT_TOKEN }}
Expand Down

0 comments on commit debd0b6

Please sign in to comment.