Skip to content

Commit

Permalink
Merge pull request #31 from viadee/feat/image-build-workflow
Browse files Browse the repository at this point in the history
Feat: image build workflow
  • Loading branch information
MaxStroh authored Apr 19, 2024
2 parents f000642 + 76e0987 commit 81dba6d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2

updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
55 changes: 49 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Release Charts

on:
push:
branches:
- main
release:
types:
- prereleased
- released

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -19,12 +20,54 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# Helm Chart
- name: Install Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: v3.5.0

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

# Create metadata for docker images
- name: Generate Docker Metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: |
viadee/docker-hub-rate-limit-exporter
public.ecr.aws/viadee/docker-hub-rate-limit-exporter
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Login to DockerHub and ECR
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_SA_USERNAME }}
password: ${{ secrets.DOCKER_HUB_SA_PASSWORD }}

- name: Login to ECR
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_PROD_ECR_VIADEE_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_PROD_ECR_VIADEE_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1

# build & push images
- name: Set up Docker Buildx # needed for multi-platform builds
uses: docker/setup-buildx-action@v3
- name: Build & Push Docker Images
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.metadata-ecr.outputs.tags }}
labels: ${{ steps.metadata-ecr.outputs.labels }}

0 comments on commit 81dba6d

Please sign in to comment.