-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: BuildImage | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: { } | ||
|
||
jobs: | ||
build-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
oamdev/terraform-controller | ||
ghcr.io/kubevela/oamdev/terraform-controller | ||
tags: | | ||
type=ref,event=tag | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- name: Login docker.io | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: HelmChart | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
publish-charts: | ||
env: | ||
HELM_CHART: chart/ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.4.0 | ||
- name: Get the version | ||
id: get_version | ||
run: | | ||
VERSION=${GITHUB_REF#refs/tags/} | ||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | ||
- name: Tag helm chart image | ||
run: | | ||
image_tag=${{ steps.get_version.outputs.VERSION }} | ||
chart_version=${{ steps.get_version.outputs.VERSION }} | ||
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml | ||
chart_semver=${chart_version#"v"} | ||
sed -i "s/0.1.0/$chart_semver/g" $HELM_CHART/Chart.yaml | ||
- uses: jnwng/github-app-installation-token-action@v2 | ||
id: get_app_token | ||
with: | ||
appId: 340472 | ||
installationId: 38064967 | ||
privateKey: ${{ secrets.GH_KUBEVELA_APP_PRIVATE_KEY }} | ||
- name: Sync Chart Repo | ||
run: | | ||
git config --global user.email "135009839+kubevela[bot]@users.noreply.github.com" | ||
git config --global user.name "kubevela[bot]" | ||
git clone https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git kubevela-charts | ||
helm package $HELM_CHART --destination ./kubevela-charts/docs/ | ||
helm repo index --url https://kubevela.github.io/charts ./kubevela-charts/docs/ | ||
cd kubevela-charts/ | ||
git add docs/ | ||
chart_version=${GITHUB_REF#refs/tags/} | ||
git commit -m "update terraform-controller chart ${chart_version}" | ||
git push https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
apiVersion: v1 | ||
name: terraform-controller | ||
version: 0.2.8 | ||
version: 0.1.0 | ||
description: A Kubernetes Terraform controller | ||
home: https://github.com/oam-dev/terraform-controller | ||
appVersion: "0.3.3" | ||
appVersion: 0.1.0 |
This file contains 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