Skip to content

Commit

Permalink
Merge pull request #31 from bcgov/readmechange
Browse files Browse the repository at this point in the history
chore: allow manual trigger of loki
  • Loading branch information
thegentlemanphysicist authored Feb 3, 2023
2 parents 6cb1ae7 + 3397684 commit f25ee9d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/publish-loki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
paths:
- helm/loki/**
- .github/workflows/publish-loki.yml
workflow_dispatch:
inputs:
environment:
description: The target environment
required: true
options: [sandbox, production]

jobs:
build-and-push-image:
Expand All @@ -23,7 +29,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 @@ -36,7 +44,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 f25ee9d

Please sign in to comment.