-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from viadee/feat/image-build-workflow
Feat: image build workflow
- Loading branch information
Showing
2 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
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
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" |
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
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 | ||
|
||
|
@@ -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 }} |