Skip to content

Update all container images to latest versions #40

Update all container images to latest versions

Update all container images to latest versions #40

Workflow file for this run

name: 'Release'
on:
push:
branches:
- 'main'
paths:
- 'charts/**/Chart.yaml'
jobs:
package:
permissions:
contents: 'write' # to push chart release and create a release (helm/chart-releaser-action)
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout Code'
uses: 'actions/checkout@v4'
- name: 'Fetch history'
run: 'git fetch --prune --unshallow'
- name: 'Configure Git'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: 'Set up Helm'
uses: 'azure/setup-helm@v3.5'
with:
version: 'v3.12.0'
- name: 'Prepare packaging'
run: |
#!/bin/sh
# Fetch current index.yaml
CR_INDEX_DIR=.cr-index
mkdir "$CR_INDEX_DIR"
make pre-fetch DIST="$CR_INDEX_DIR"
- name: 'Run chart-releaser'
uses: 'helm/chart-releaser-action@6203d709ca237fb26b724837f2c53716f244ee8c'
with:
skip_upload: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true
CR_SKIP_EXISTING: true
- name: 'Move to upload path'
run: |
mkdir -p ./dist/charts
mv .cr-release-packages/* ./dist/charts
make pre-fetch && make index
ls -R ./dist/
- name: 'Upload Packaged Charts as Artifacts'
uses: 'actions/upload-artifact@v4'
with:
name: 'dist'
path: 'dist/'
deploy:
runs-on: 'ubuntu-latest'
needs: ['package']
steps:
- uses: 'actions/checkout@v4'
- name: 'Download Packaged Charts'
uses: 'actions/download-artifact@v4'
with:
name: 'dist'
path: 'dist'
- name: 'Get AWS environment variables'
run: |
echo AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} >> .env.cdk
echo AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} >> .env.cdk
echo AWS_DEFAULT_REGION=${{ vars.AWS_DEFAULT_REGION }} >> .env.cdk
echo "${{ vars.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
- name: 'Configure AWS Credentials'
uses: 'aws-actions/configure-aws-credentials@v4'
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_DEFAULT_REGION }}
- name: 'Invalidate CloudFront Distribution for index.yaml'
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/charts/index.yaml"