Skip to content

Commit

Permalink
fix version in cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathchandra24 committed Mar 3, 2024
1 parent 1310ba5 commit 69b0bbe
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 54 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/build-op-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,62 +65,62 @@ jobs:
echo "IMAGE_NAME=${{ env.GITHUB_IMAGE }}" >> $GITHUB_OUTPUT
echo "DOCKER_IMG_NAME=${{env.DOCKER_REPO}}/${{ env.DOCKER_IMAGE }}" >> $GITHUB_OUTPUT
operator-build:
runs-on: ubuntu-latest
timeout-minutes: 30
name: Build Image for Fluent Operator
needs:
- build-image-metadata
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
# operator-build:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# name: Build Image for Fluent Operator
# needs:
# - build-image-metadata
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# fetch-depth: 0

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

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./cmd/fluent-manager/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ needs.build-image-metadata.outputs.tags }}
labels: ${{ needs.build-image-metadata.outputs.labels }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./cmd/fluent-manager/Dockerfile
# push: true
# platforms: linux/amd64,linux/arm64
# tags: ${{ needs.build-image-metadata.outputs.tags }}
# labels: ${{ needs.build-image-metadata.outputs.labels }}

scan-operator-image:
name: Scan Docker Image
needs:
- operator-build
- build-image-metadata
uses: ./.github/workflows/call-scan-images.yaml
with:
source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}:${{ needs.build-image-metadata.outputs.version }}"
source_registry: ghcr.io
platforms: '["linux/arm64", "linux/amd64"]'
secrets:
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
# scan-operator-image:
# name: Scan Docker Image
# needs:
# - operator-build
# - build-image-metadata
# uses: ./.github/workflows/call-scan-images.yaml
# with:
# source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}:${{ needs.build-image-metadata.outputs.version }}"
# source_registry: ghcr.io
# platforms: '["linux/arm64", "linux/amd64"]'
# secrets:
# registry_username: ${{ github.actor }}
# registry_password: ${{ secrets.GITHUB_TOKEN }}

release-image-to-docker-hub:
if: always()
name: Release Image to Docker Hub
uses: ./.github/workflows/call-clone-images.yaml
needs:
- operator-build
- scan-operator-image
# - operator-build
# - scan-operator-image
- build-image-metadata
with:
source_image: "${{ needs.build-image-metadata.outputs.IMG_NAME }}:${{ needs.build-image-metadata.outputs.version }}"
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/call-clone-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,10 @@
needs: check-image-exists
runs-on: ubuntu-latest
steps:
- name: Login to Docker Registry
run: |
echo "${{ secrets.target_registry_token }}" | docker login ${{ inputs.target_registry }} -u ${{ secrets.target_registry_username }} --password-stdin
mkdir -p $HOME/.docker
cp ~/.docker/config.json $HOME/.docker/auth.json
env:
DOCKER_CONFIG: /home/runner/work/_temp/.docker

- name: Promote container images from ${{ inputs.source_registry }} to ${{ inputs.target_registry }}
run: |
echo "Promoting $SOURCE_IMAGE to $RELEASE_IMAGE"
docker run --rm \
-v $HOME/.docker:/root/.docker \
quay.io/skopeo/stable:latest \
copy \
--all \
Expand All @@ -96,3 +87,4 @@
SOURCE_IMAGE: ${{ inputs.source_registry }}/${{ inputs.source_image }}
RELEASE_IMAGE: ${{ inputs.target_registry }}/${{ inputs.target_image }}
RELEASE_CREDS: ${{ secrets.target_registry_username }}:${{ secrets.target_registry_token }}

0 comments on commit 69b0bbe

Please sign in to comment.