Build Container and Helm Chart from fix-helm-chart by @s-vitaliy #7
Workflow file for this run
This file contains hidden or 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
| name: Build Image | |
| run-name: Build Container and Helm Chart from ${{github.ref_name}} by @${{ github.actor }} | |
| on: workflow_dispatch | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build_image: | |
| name: Build Docker Image and Helm Charts | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3.5.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get project version | |
| uses: SneaksAndData/github-actions/generate_version@v0.1.11 | |
| id: version | |
| - name: Get build number | |
| shell: bash | |
| id: buildnumber | |
| run: | | |
| dt=$(date +'%Y%m%d%H%M%S') | |
| echo "result=$dt" >> "$GITHUB_OUTPUT" | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}},value=${{steps.version.outputs.version}} | |
| flavor: | |
| latest=false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3.11.1 | |
| with: | |
| use: true | |
| platforms: linux/arm64,linux/amd64 | |
| # bandaid Microsoft: https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930 | |
| - name: Claim disk space | |
| run: | | |
| # Remove unused tools | |
| sudo rm -rf /opt/microsoft # 783M | |
| sudo rm -rf /usr/lib/llvm-* # 1900M | |
| sudo rm -rf /usr/local/julia* # 1008M | |
| sudo rm -rf /usr/local/share/chromium # 613M | |
| sudo rm -rf /usr/local/share/powershell # 1244M | |
| sudo rm -rf /usr/share/swift # 3207M | |
| sudo df -TBG / | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6.18.0 | |
| with: | |
| context: . | |
| build-args: | | |
| APPVERSION=${{ steps.version.outputs.version }} | |
| BUILDNUMBER=${{ steps.buildnumber.outputs.result }} | |
| file: .container/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/arm64,linux/amd64 | |
| - name: Build and Push Chart | |
| uses: SneaksAndData/github-actions/build_helm_chart@v0.1.11 | |
| with: | |
| application: arcane-operator | |
| app_version: ${{ steps.meta.outputs.version }} | |
| container_registry_user: ${{ github.actor }} | |
| container_registry_token: ${{ secrets.GITHUB_TOKEN }} | |
| container_registry_address: ghcr.io/sneaksanddata/ |