Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 2 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,10 @@ on:
options:
- 'true'
- 'false'
ENV:
required: true
default: 'testing'
type: choice
options:
- testing
- staging
- production

env:
BRANCH: ${{ github.event.inputs.BRANCH || github.ref }}
DEPLOY: ${{ github.event.inputs.DEPLOY || 'false' }}
ENV: ${{ github.event.inputs.ENV || 'testing' }}

jobs:
build:
Expand Down Expand Up @@ -96,35 +87,13 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- name: Setup deploy environment
id: deploy_environment
run: |
case $GITHUB_EVENT_NAME in
workflow_dispatch)
echo "::set-output name=ENV::${{ env.ENV }}"
echo "::set-output name=DEPLOY::${{ env.DEPLOY }}"
;;
pull_request)
echo "::set-output name=ENV::staging"
echo "::set-output name=DEPLOY::false"
;;
push)
echo "::set-output name=ENV::staging"
echo "::set-output name=DEPLOY::true"
;;
*)
echo "::set-output name=ENV::staging"
echo "::set-output name=DEPLOY::false"
;;
esac

- name: Update Netdata Infra
if: ${{ steps.deploy_environment.outputs.DEPLOY == 'true' }}
if: github.event_name == 'workflow_dispatch'
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
repo: ${{ secrets.NETDATA_INFRA_REPO }}
workflow: Netdata Grafana Plugin Deploy
ref: master
inputs: '{"artifact_name": "${{ needs.build.outputs.artifact_name }}", "env": "${{ steps.deploy_environment.outputs.ENV }}", "workflow_run_id": "${{ github.run_id }}"}'
inputs: '{"artifact_name": "${{ needs.build.outputs.artifact_name }}", "env": "testing", "workflow_run_id": "${{ github.run_id }}"}'
continue-on-error: true
17 changes: 0 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,3 @@ jobs:
asset_path: ./${{ steps.metadata.outputs.archive-checksum }}
asset_name: ${{ steps.metadata.outputs.archive-checksum }}
asset_content_type: text/plain

outputs:
artifact_name: ${{ steps.metadata.outputs.archive }}

internal-deploy:
needs: release
runs-on: ubuntu-latest
steps:
- name: Update Netdata Infra
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
repo: ${{ secrets.NETDATA_INFRA_REPO }}
workflow: Netdata Grafana Plugin Deploy
ref: master
inputs: '{"artifact_name": "${{ needs.release.outputs.artifact_name }}", "env": "production", "workflow_run_id": "${{ github.run_id }}"}'
continue-on-error: true
Loading