Skip to content

Commit

Permalink
Add CDK deployment step
Browse files Browse the repository at this point in the history
  • Loading branch information
drinkataco committed Feb 4, 2024
1 parent 446853a commit a01967a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
39 changes: 26 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
# token: ${{ secrets.PAT }}

- name: 'Set up Helm'
run: |
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit a01967a

Please sign in to comment.