diff --git a/.github/workflows/helm-linter.yml b/.github/workflows/helm-linter.yml new file mode 100644 index 0000000..47a7347 --- /dev/null +++ b/.github/workflows/helm-linter.yml @@ -0,0 +1,19 @@ +name: Lint and validate Helm chart +on: + pull_request: + types: [opened, reopened, edited] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup helm + uses: azure/setup-helm@v3 + with: + version: 'v3.10.0' + id: install-helm + + - name: Test helm + run: helm template helm-charts/k8s-mediaserver diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml new file mode 100644 index 0000000..452a721 --- /dev/null +++ b/.github/workflows/release-workflow.yml @@ -0,0 +1,72 @@ +name: Build and Push Image +on: + push: + branches: + - master + +jobs: + versioning: + name: Check and manage versioning + runs-on: ubuntu-latest + outputs: + release_tag: ${{ steps.bump-version.outputs.new_tag || steps.bump-version.outputs.previous_tag }} + + steps: + - uses: actions/checkout@v3 + + - name: Bump version and push tag + uses: mathieudutour/github-tag-action@v6.1 + id: bump-version + with: + github_token: ${{ secrets.GH_TOKEN }} + default_bump: false + + build_image: + needs: versioning + name: Build and push container images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build Image - x86_64 + id: build-image-x86_64 + uses: redhat-actions/buildah-build@v2 + with: + image: k8s-mediaserver-operator + tags: latest ${{ needs.versioning.outputs.release_tag }} + containerfiles: | + ./Dockerfile + + - name: Build Image - ARM64 + id: build-image-arm64 + uses: redhat-actions/buildah-build@v2 + with: + image: k8s-mediaserver-operator + tags: latest-arm64 ${{ needs.versioning.outputs.release_tag }}-arm64 + containerfiles: | + ./Dockerfile-arm64 + + - name: Push To quay.io + id: push-x86 + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image-x86_64.outputs.image }} + tags: latest ${{ needs.versioning.outputs.release_tag }} + registry: quay.io/kubealex + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_TOKEN }} + + - name: Push To quay.io + id: push-arm64 + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image-arm64.outputs.image }} + tags: latest-arm64 ${{ needs.versioning.outputs.release_tag }}-arm64 + registry: quay.io/kubealex + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_TOKEN }} + + - name: Print image url + run: echo "Images pushed to {{ steps.push-x86.outputs.registry-paths }} and ${{ steps.push-arm64.outputs.registry-paths }}" + +