Skip to content

Merge pull request #33 from aservo/helmfile-0.165.0 #178

Merge pull request #33 from aservo/helmfile-0.165.0

Merge pull request #33 from aservo/helmfile-0.165.0 #178

Workflow file for this run

name: build
env:
IMAGE: helmfile
on:
# Careful: Changing any of the triggers may
# lead to image pushed on unwanted branches,
# see the branch-based event usages below!
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
jobs:
build:
name: Build Image
runs-on: ubuntu-latest
env:
TAG: canary
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set tag for non-main-branch builds
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "TAG=pr${{github.event.number}}" >> $GITHUB_ENV
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
load: true
tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }}
- name: Versions (Tests)
run: |
# make sure the kubectl binary can be found and executed
docker run ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }} kubectl version --client=true
# make sure the helm binary can be found and executed
docker run ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }} helm version
# make sure the helm plugins can be found and executed (just test diff)
docker run ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }} helm diff version
# make sure helmfile binary can be found and executed
docker run ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }} helmfile version
# make sure az binary can be found and executed
docker run ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }} az version
- name: Push
run: |
docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }}
- name: Push latest
if: github.event_name == 'release'
run: |
docker tag ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }} \
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:latest
docker push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:latest
- name: Inspect
run: |
docker image inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.TAG }}