Skip to content

Commit

Permalink
workflow: set branch name tag for non-main branch using docker/metada…
Browse files Browse the repository at this point in the history
…ta-action
  • Loading branch information
KevFan committed Oct 18, 2023
1 parent 078dbc0 commit b2d8f01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
tags: ['*']

env:
IMG_TAGS: ${{ github.sha }}
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
MAIN_BRANCH_NAME: main
Expand All @@ -26,14 +25,6 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
# - name: Add latest tag
# if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
# run: |
# echo "IMG_TAGS=${{ env.IMG_TAGS }} latest" >> $GITHUB_ENV
# - name: Add branch name tag
# if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
# run: |
# echo "IMG_TAGS=${{ env.IMG_TAGS }} ${{ github.ref_name }}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -46,7 +37,9 @@ jobs:
${{ env.IMG_REGISTRY_HOST}}/${{ env.IMG_REGISTRY_ORG }}/limitador
tags: |
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=latest,enable=${{ github.ref_name == env.MAIN_BRANCH_NAME }}
# set branch name tag for non-main branches
type=raw,value=${{ github.ref_name }},enable=${{ github.ref_name != env.MAIN_BRANCH_NAME }}
type=sha
- name: Login to container registry
uses: docker/login-action@v2
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
# - name: Build Limitador Image
# id: build-image
# uses: redhat-actions/buildah-build@v2
# with:
# image: limitador-testing
# tags: latest
# dockerfiles: |
# ./Dockerfile
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
Expand All @@ -54,8 +46,6 @@ jobs:
- name: Load limitador docker image
run: |
kind load docker-image ${{ steps.meta.outputs.tags }} -n limitador-local
# docker save -o image.tar ${{ steps.meta.outputs.tags }}
# kind load image-archive --name limitador-local image.tar
- name: Deploy limitador
run: |
kubectl apply -f limitador-server/e2e/file-watcher/configmap.yaml
Expand Down

0 comments on commit b2d8f01

Please sign in to comment.