diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..d64e00a --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,24 @@ +name: Docker +on: [release] +jobs: + build-release: + name: Release Docker Image + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + + - name: Set up Operator SDK v0.10.0 + run: curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/v0.10.0/operator-sdk-v0.10.0-x86_64-linux-gnu && sudo install -m 755 operator-sdk-v0.10.0-x86_64-linux-gnu /usr/local/bin/operator-sdk + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Login to Docker + run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }} + + - name: Release + run: make release diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml new file mode 100644 index 0000000..e395582 --- /dev/null +++ b/.github/workflows/go.yaml @@ -0,0 +1,27 @@ +name: Go +on: [pull_request] +jobs: + build-release: + name: Build + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + + - name: Set up Operator SDK v0.10.0 + run: curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/v0.10.0/operator-sdk-v0.10.0-x86_64-linux-gnu && sudo install -m 755 operator-sdk-v0.10.0-x86_64-linux-gnu /usr/local/bin/operator-sdk + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Get dependencies + run: go mod download + + - name: Test + run: go test ./... + + - name: Build + run: make build diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml new file mode 100644 index 0000000..3fe684e --- /dev/null +++ b/.github/workflows/helm.yaml @@ -0,0 +1,33 @@ +name: Helm +on: [release] +jobs: + build-release: + name: Release Helm Chart + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Configure git + run: git config --global user.email "mail@ricoberger.de" && git config --global user.name "ricoberger" + + - name: Package Helm chart + run: helm init --client-only && helm package ./charts/vault-secrets-operator + + - name: Clone Helm repository + run: git clone https://github.com/ricoberger/helm-charts.git + + - name: Update Helm repository + run: mv vault-secrets-operator* ./helm-charts/ && helm repo index helm-charts/ --url https://ricoberger.github.io/helm-charts/ + + - name: Commit changes + run: cd helm-charts/ && git add . && git commit -m "Add new release for Vault Secrets Operator" + + - name: Push changes + run: cd helm-charts/ && git push https://ricoberger:${{ secrets.TOKEN }}@github.com/ricoberger/helm-charts.git