Skip to content

Commit

Permalink
ci: github action to push image to quay
Browse files Browse the repository at this point in the history
Adding a github action to build and push
docker image to quay

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Aug 5, 2024
1 parent 4d61a8a commit 28f1101
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: push
on:
pull_request:
branches:
- main
- release-*

jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.repository == 'ceph/ceph-csi-operator'
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

#- name: Login to Quay.io
#uses: docker/login-action@v3
#with:
# registry: quay.io
# username: ${{ secrets.QUAY_IO_USERNAME }}
# password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Set up Image tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/heads\///')
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV
fi
- name: print env
run: echo $TAG

- name: Build and push Docker images
run: make docker-buildx IMAGE_TAG=${{ env.IMAGE_TAG }}

0 comments on commit 28f1101

Please sign in to comment.