diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 46084e6..3af9b64 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,7 +26,6 @@ jobs: - uses: 'actions/checkout@v4' with: fetch-depth: 0 - # token: ${{ secrets.PAT }} - name: 'Set up Helm' run: | @@ -73,24 +72,38 @@ jobs: run: | #!/bin/bash set -e - set -x source ./updated_charts.sh git fetch --tags cd "$(git rev-parse --show-toplevel)" || exit 1 # Go to git root - make package CHARTS="$(updated_charts "$PREVIOUS_VERSION" "$CURRENT_VERSION" './charts/*')" CHARTS_DIR='./' + make build CHARTS="$(updated_charts "$PREVIOUS_VERSION" "$CURRENT_VERSION" './charts/*')" CHARTS_DIR='./' - # - name: 'Update Chart Index' - # run: 'echo TODO' + - uses: 'actions/cache@v4' + with: + path: 'dist' + key: ${{ runner.os }}-${{ hashFiles('dist') }} - # - name: 'Upload Artefacts' - # run: 'echo TODO' + deploy: + runs-on: 'ubuntu-latest' + needs: ['package'] + steps: + - uses: 'actions/checkout@v4' + - uses: 'actions/cache@v4' + with: + path: 'dist' + key: ${{ runner.os }}-${{ hashFiles('dist') }} + - name: 'Get AWS environment variables' + run: | + echo AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} >> .env.cdk - # - name: 'Package Charts' - # run: './.github/workflows/scripts/' + echo AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} >> .env.cdk - # - name: 'Update Chart Index' - # run: 'echo TODO' + echo AWS_DEFAULT_REGION=${{ varables.AWS_DEFAULT_REGION }} >> .env.cdk - # - name: 'Upload Artefacts' - # run: 'echo TODO' + echo "${{ variables.DEPLOY_ENV_FILE }}" >> .env.cdk + - uses: 'addnab/docker-run-action@v3' + with: + image: 'ghcr.io/drinkataco/cdk-static-site:latest' + options: --volume ${{ github.workspace }}/dist:/srv --env-file=.env.cdk + run: | + npm run cdk:deploy -- --require-approval never diff --git a/Makefile b/Makefile index 0a1788e..174de7c 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,17 @@ .PHONY: all lint package index clean CHARTS_DIR ?= charts/ -DIST := dist +DIST := dist/charts # Default value for CHILD_CHARTS is set to a shell command that finds all directories in CHARTS_DIR # This can be overridden by passing CHILD_CHARTS="chart1 chart2" to the make command CHARTS ?= $(shell ls -d $(CHARTS_DIR)/*/ | xargs -n 1 basename) # Location of Repo -HELM_REPO ?= https://media-servarr.github.io/charts +HELM_REPO ?= https://media-servarr./charts # Default target -all: lint package pre-fetch index +build: package pre-fetch index # Lint the Helm charts lint: