diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..66c1e7f6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,69 @@ +--- + +kind: pipeline +type: kubernetes +name: helm lint + +platform: + os: linux + arch: amd64 + +trigger: + event: + - pull_request + branch: + - main + +steps: + - name: lint-helm-chart + image: pelotech/drone-helm3 + settings: + mode: lint + chart: helm + values_files: helm/values.yaml + values: + - app.image.version=$${DRONE_COMMIT_SHA} + +--- +kind: pipeline +type: kubernetes +name: deployment + +platform: + os: linux + arch: amd64 + +trigger: + event: + - push + branch: + - main + +steps: + - name: Wait for image tag + image: alpine/curl:8.2.1 + commands: + - | + while ! curl -s -L 'https://quay.io/api/v1/repository/ukhomeofficedigital/engineering-guidance-and-standards/tag?specificTag=${DRONE_COMMIT_SHA}' | grep -q '${DRONE_COMMIT_SHA}' ; do + echo "Tag not present, waiting 10 seconds" + sleep 10 + done + + - name: Deployment + image: pelotech/drone-helm3 + settings: + chart: helm + mode: upgrade + namespace: sas-prod + release: engineering-guidance-and-standards + kube_certificate: + from_secret: kube_cert_acp_prod + kube_api_server: https://kube-api-prod.prod.acp.homeoffice.gov.uk + kube_token: + from_secret: kube_token_acp_prod + values_files: helm/values.yaml + wait_for_upgrade: true + timeout: 10m + history_max: 3 + values: + - app.image.version=$${DRONE_COMMIT_SHA} diff --git a/.github/workflows/build-and-deploy-main.yml b/.github/workflows/build-and-deploy-main.yml deleted file mode 100644 index 8c1fdf82..00000000 --- a/.github/workflows/build-and-deploy-main.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: build-and-deploy-main - -on: - push: - branches: - - main - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: 'npm' - - name: Build - run: | - npm ci --omit=dev - npm run build - env: - PATH_PREFIX: /engineering-guidance-and-standards - SITE_ROOT: https://ho-cto.github.io/engineering-guidance-and-standards/ - - name: Upload Pages Artifact - uses: actions/upload-pages-artifact@v2 - with: - path: _site - deploy: - runs-on: ubuntu-22.04 - needs: build - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - uses: actions/deploy-pages@v2 - id: deployment