From fa01de20b0c5a7bc15b8033b33f808369f505224 Mon Sep 17 00:00:00 2001 From: Chanyeong Lim Date: Mon, 9 Mar 2026 16:12:22 +0900 Subject: [PATCH] =?UTF-8?q?image=20update=ED=95=98=EB=8A=94=20action=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/update-image-tag/action.yml | 55 --------------------- .github/workflows/_deploy-native.yml | 10 ---- .github/workflows/_deploy.yml | 10 ---- 3 files changed, 75 deletions(-) delete mode 100644 .github/actions/update-image-tag/action.yml diff --git a/.github/actions/update-image-tag/action.yml b/.github/actions/update-image-tag/action.yml deleted file mode 100644 index 221e279..0000000 --- a/.github/actions/update-image-tag/action.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Update image tag in waffle-world-oci -description: Updates the image tag in waffle-world-oci ArgoCD manifests - -inputs: - app-id: - required: true - private-key: - required: true - ocir-registry: - required: true - ocir-namespace: - required: true - ocir-repository: - required: true - image-tag: - required: true - -runs: - using: composite - steps: - - name: Generate GitHub App token - id: app-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ inputs.app-id }} - private-key: ${{ inputs.private-key }} - owner: wafflestudio - repositories: waffle-world-oci - - - name: Update image tag - shell: bash - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} - OCIR_IMAGE: ${{ inputs.ocir-registry }}/${{ inputs.ocir-namespace }}/${{ inputs.ocir-repository }} - OCIR_REPOSITORY: ${{ inputs.ocir-repository }} - IMAGE_TAG: ${{ inputs.image-tag }} - run: | - REPO="wafflestudio/waffle-world-oci" - ENV_DIR=$(dirname "$OCIR_REPOSITORY") - DIR="argocd/$ENV_DIR" - - for FILE_PATH in $(gh api "repos/$REPO/contents/$DIR" --jq '.[] | select(.name | endswith(".yaml") or endswith(".yml")) | .path'); do - CONTENT=$(gh api "repos/$REPO/contents/$FILE_PATH" --jq '.content' | base64 -d) - if echo "$CONTENT" | grep -q "image: $OCIR_IMAGE:"; then - UPDATED=$(echo "$CONTENT" | sed "s|image: $OCIR_IMAGE:[^ ]*|image: $OCIR_IMAGE:$IMAGE_TAG|g") - if [ "$CONTENT" != "$UPDATED" ]; then - SHA=$(gh api "repos/$REPO/contents/$FILE_PATH" --jq '.sha') - gh api --method PUT "repos/$REPO/contents/$FILE_PATH" \ - -f message="build: update $OCIR_REPOSITORY to $IMAGE_TAG" \ - -f content="$(echo "$UPDATED" | base64 -w 0)" \ - -f sha="$SHA" - echo "Updated $FILE_PATH" - fi - fi - done diff --git a/.github/workflows/_deploy-native.yml b/.github/workflows/_deploy-native.yml index 2387c95..dc58cdf 100644 --- a/.github/workflows/_deploy-native.yml +++ b/.github/workflows/_deploy-native.yml @@ -50,13 +50,3 @@ jobs: rm -f .github_token docker push $OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG echo "image=$OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - - - name: Update image tag in waffle-world-oci - uses: ./.github/actions/update-image-tag - with: - app-id: ${{ secrets.DEPLOYER_APP_ID }} - private-key: ${{ secrets.DEPLOYER_APP_PRIVATE_KEY }} - ocir-registry: ${{ env.OCIR_REGISTRY }} - ocir-namespace: ${{ env.OCIR_NAMESPACE }} - ocir-repository: ${{ env.OCIR_REPOSITORY }} - image-tag: ${{ env.IMAGE_TAG }} diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml index 6889aff..9bb7933 100644 --- a/.github/workflows/_deploy.yml +++ b/.github/workflows/_deploy.yml @@ -50,13 +50,3 @@ jobs: rm -f .github_token docker push $OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG echo "image=$OCIR_REGISTRY/$OCIR_NAMESPACE/$OCIR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - - - name: Update image tag in waffle-world-oci - uses: ./.github/actions/update-image-tag - with: - app-id: ${{ secrets.DEPLOYER_APP_ID }} - private-key: ${{ secrets.DEPLOYER_APP_PRIVATE_KEY }} - ocir-registry: ${{ env.OCIR_REGISTRY }} - ocir-namespace: ${{ env.OCIR_NAMESPACE }} - ocir-repository: ${{ env.OCIR_REPOSITORY }} - image-tag: ${{ env.IMAGE_TAG }}