forked from ceph/ceph-csi-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
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 ceph#86 from Madhu-1/docker-build-push
ci: github action for docker build push
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 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,49 @@ | ||
name: build-and-push | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release-* | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
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: | | ||
echo "image tag ${{ github.ref }}" | ||
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 $IMAGE_TAG | ||
|
||
- name: Build and push Docker images | ||
run: make docker-buildx IMAGE_TAG=${{ env.IMAGE_TAG }} |
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