Release Charts & Publish Images #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Charts | |
on: | |
release: | |
types: | |
- prereleased | |
- released | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
# Helm Chart | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.5.0 | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
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}} | |
type=semver,pattern={{major}} | |
# 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.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} |