diff --git a/.github/workflows/build-publish-docker-helm.yaml b/.github/workflows/build-publish-docker-helm.yaml deleted file mode 100644 index 7312357e82..0000000000 --- a/.github/workflows/build-publish-docker-helm.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: Builds and pushes Docker Images and Helm charts to Github Registry - -on: - # Build and push Docker image and Helm charts on every push to develop branch - # and on every tag push - push: - branches: - - develop - - master - tags: - - "**" - -permissions: - packages: write - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Install chart publishing dependencies (chartpress, helm) - run: | - pip install chartpress - pip list - - helm version - - - name: Build and push Docker image. Update the image tag, chart version etc as needed - run: | - cd deploy/helm - # hack to push the image to ghcr.io. We will update chartpress.yaml when we move to separate deploy repo - python -c "import re; data=open('chartpress.yaml').read(); open('chartpress.yaml', 'w').write(re.sub(r'ifrcgoacr.azurecr.io/ifrcgo-', 'ghcr.io/ifrcgo/go-', data))" - chartpress --push - - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::$(cat deploy/helm/ifrcgo-helm/Chart.yaml | grep version | awk '{print $2}') - - - name: Package Helm Chart - run: | - helm package deploy/helm/ifrcgo-helm -d .helm-charts - - - name: Push Helm Chart - run: | - helm push .helm-charts/ifrcgo-helm-${{ steps.get_version.outputs.VERSION }}.tgz oci://ghcr.io/ifrcgo/go-api \ No newline at end of file diff --git a/.github/workflows/build-publish-docker-helm.yml b/.github/workflows/build-publish-docker-helm.yml new file mode 100644 index 0000000000..b2d0e22e94 --- /dev/null +++ b/.github/workflows/build-publish-docker-helm.yml @@ -0,0 +1,64 @@ +name: Builds and pushes Docker Images and Helm charts to Github Registry + +on: + # Build and push Docker image and Helm charts on every push to develop branch + # and on every tag push + push: + branches: + - develop + - master + - feature/migrate-to-gh + tags: + - "**" + +permissions: + packages: write + +jobs: + test: + uses: ./.github/workflows/ci.yml + + build: + name: 🚴 Publish Helm 🚴 + needs: test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Install chart publishing dependencies (chartpress, helm) + run: | + pip install chartpress + pip list + + helm version + + # - name: Build and push Docker image. Update the image tag, chart version etc as needed + # run: | + # cd deploy/helm + # # hack to push the image to ghcr.io. We will update chartpress.yaml when we move to separate deploy repo + # python -c "import re; data=open('chartpress.yaml').read(); open('chartpress.yaml', 'w').write(re.sub(r'ifrcgoacr.azurecr.io/ifrcgo-', 'ghcr.io/ifrcgo/go-', data))" + # chartpress --push + + # - name: Get the version + # id: get_version + # run: echo ::set-output name=VERSION::$(cat deploy/helm/ifrcgo-helm/Chart.yaml | grep version | awk '{print $2}') + + # - name: Package Helm Chart + # run: | + # helm package deploy/helm/ifrcgo-helm -d .helm-charts + + # - name: Push Helm Chart + # run: | + # helm push .helm-charts/ifrcgo-helm-${{ steps.get_version.outputs.VERSION }}.tgz oci://ghcr.io/ifrcgo/go-api diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c748a15f4..22bdc909f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,6 @@ on: pull_request: # NOTE: For develop & master, they are run through helm github action ./build-publish-docker-helm.yml -permissions: - id-token: write # This is required for requesting the JWT - contents: read # This is required for actions/checkout jobs: pre_commit_checks: