Fix namespace duplication, add tests, update docs (#4) #14
This file contains hidden or 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: Build and Push Docker Image | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'charts/**' | |
- 'app/**' | |
- 'Dockerfile' | |
env: | |
IMAGE_NAME: cert-manager-key-vault-sync | |
REPOSITORY_NAME: rdvansloten | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install yq | |
run: | | |
sudo add-apt-repository ppa:rmescandon/yq | |
sudo apt update | |
sudo apt install yq -y | |
- name: Read version from YAML | |
id: read_version | |
run: | | |
version=$(yq eval '.version' meta.yaml) | |
echo "APP_VERSION=$version" >> "$GITHUB_ENV" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PAT }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 | |
context: . | |
push: true | |
tags: ${{ env.REPOSITORY_NAME }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REPOSITORY_NAME }}/${{ env.IMAGE_NAME }}:${{ env.APP_VERSION }} | |
- name: Logout from Docker Hub | |
run: docker logout |