From a29a1aae838be335f4e98da1ce5a3497ddd31537 Mon Sep 17 00:00:00 2001 From: james Hart Date: Mon, 9 Dec 2024 16:05:12 +0000 Subject: [PATCH] run a deployment ever --- .github/workflows/bootstrap-actions.yml | 65 ---------------------- .github/workflows/new_renovate_pr.yml | 8 +-- .github/workflows/pipeline.yml | 2 +- .github/workflows/scheduled_deployment.yml | 18 +----- 4 files changed, 7 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/bootstrap-actions.yml diff --git a/.github/workflows/bootstrap-actions.yml b/.github/workflows/bootstrap-actions.yml deleted file mode 100644 index 3fff4f3..0000000 --- a/.github/workflows/bootstrap-actions.yml +++ /dev/null @@ -1,65 +0,0 @@ -# This is intended to be the main workflow from which actions are run to bootstrap a new project -# -# Requires -# -# Secrets -# SERVICE_CATALOGUE_API_KEY -# QUAYIO_TOKEN -# CIRCLECI_TOKEN -# -# Steps -# Prompt for the component name (must match service catalogue) -# Gather information from Service Catalogue fo rthis component -# Optional bits: -# Create the github repository based on the template -# Configure CircleCI -# Configure QuayIO -# Configue kubectl namespace secrets and things -# -# Maybe some options to exclude / only include some elements like the bootstrap.sh -# - k specify whether to only run the circleci kubectl changes -# - s specify whether to only run the service catalogue changes -# - r specify whether to only run the github and service catalogue changes - -name: Bootstrap Actions Workflow Dispatch - -on: - workflow_dispatch: - inputs: - component: - description: 'The component to bootstrap (needs to be in the Service Catalogue)' - required: true - options: - type: choice - description: 'Bootstrap options (default: full bootstrap, including github repo)' - required: true - default: 'full' - options: - - 'full' - - 'kubectl only' - - 'github only' - -jobs: - deploy: - runs-on: [self-hosted, hmpps-github-actions-runner] - steps: - - run: echo "Running ${{ github.event.inputs.options }} component ${{ github.event.inputs.component }}" - - name: Checkout code - uses: actions/checkout@v4 - - id: get_sc_data - name: Get service catalogue data - uses: ./.github/actions/get-sc-data - env: - github_repo_name: ${{ github.event.inputs.component }} - service_catalogue_api_key: "${{ secrets.SERVICE_CATALOGUE_API_KEY }}" - - id: update_quayio - name: Updates quay.io with component information - uses: ./.github/actions/update-quayio - if: ${{ github.event.inputs.options == 'full' || github.event.inputs.options == 'kubectl only' }} - env: - github_repo_name: ${{ github.event.inputs.component }} - github_repo_description: "${{ steps.get_sc_data.outputs.component_description }}" - quay_io_token: "${{ secrets.QUAYIO_TOKEN }}" - circle_ci_token: "${{ secrets.CIRCLECI_TOKEN }}" - - diff --git a/.github/workflows/new_renovate_pr.yml b/.github/workflows/new_renovate_pr.yml index ece9af8..9607887 100644 --- a/.github/workflows/new_renovate_pr.yml +++ b/.github/workflows/new_renovate_pr.yml @@ -1,4 +1,4 @@ -name: New PR created - Slack message if it's a renovate Dockerfile PR +name: New PR (actions/runner check) on: pull_request: @@ -11,12 +11,12 @@ jobs: contents: write steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get PR details id: get_pr_details run: | - echo "::set-output name=title::$(jq -r .pull_request.title < $GITHUB_EVENT_PATH)" - echo "::set-output name=number::$(jq -r .pull_request.number < $GITHUB_EVENT_PATH)" + echo "title=$(jq -r .pull_request.title < $GITHUB_EVENT_PATH)" >> $GITHUB_OUTPUT + echo "number=$(jq -r .pull_request.number < $GITHUB_EVENT_PATH)" >> $GITHUB_OUTPUT - name: Run action if PR title contains 'actions/runner' if: contains(steps.get_pr_details.outputs.title, 'actions/runner') uses: ./.github/actions/runner-slack-notification diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 858e4ca..91f26c4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -1,4 +1,4 @@ -name: Pipeline +name: Build -> Deploy pipeline on: push: diff --git a/.github/workflows/scheduled_deployment.yml b/.github/workflows/scheduled_deployment.yml index b1fd74d..c058489 100644 --- a/.github/workflows/scheduled_deployment.yml +++ b/.github/workflows/scheduled_deployment.yml @@ -1,23 +1,10 @@ -name: Pipeline +name: Scheduled deployment on: schedule: - - cron: "30 */12 * * *" # Every 12 hours - + - cron: "10 16,04 * * *" # Every 12 hours workflow_dispatch: - inputs: - environment: - description: Environment - type: choice - required: true - options: - - development - - production - version: - description: Image version - type: string - required: true jobs: build: @@ -29,7 +16,6 @@ jobs: # Only need to deploy to production nowadays deploy_to_prod: - if : github.ref == 'refs/heads/main' name: Deploy to prod uses: ./.github/workflows/deploy.yml needs: