Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
ebiiim committed Nov 15, 2022
1 parent 1b259c0 commit 7085018
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
tags:
- "v*"
jobs:
image:
name: Push container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository_owner }}/gitbackup-controller
tags: |
type=semver,pattern=v{{version}}
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
- run: REGISTRY=ghcr.io/${{ github.repository_owner }} ./hack/dist-manifests.sh
- uses: softprops/action-gh-release@v1
with:
files: gitbackup.yaml
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/
2. Install the controller with the following command. It creates `gitbackup-system` namespace and deploys CRDs, controllers and other resources.

```sh
# TODO(user)
kubectl apply -f https://...
kubectl apply -f https://github.com/ebiiim/gitbackup/releases/download/v0.1.0/gitbackup.yaml
```

### Deploy a `Repository` resource
Expand Down Expand Up @@ -103,8 +102,7 @@ kubectl delete --all repos -A
2. Delete the Operator.

```sh
# TODO(user)
kubectl delete -f https://...
kubectl apply -f https://github.com/ebiiim/gitbackup/releases/download/v0.1.0/gitbackup.yaml
```

## Developing
Expand Down
5 changes: 4 additions & 1 deletion hack/dist-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ PROJECT_ROOT=$(dirname "$(dirname "$SCRIPT")")
PROJECT_NAME=$(basename "$PROJECT_ROOT")

VERSION=$(git describe --tags --match "v*")
IMG=$PROJECT_NAME-controller:$VERSION
REGISTRY=${REGISTRY:-"localhost"}
IMG=$REGISTRY/$PROJECT_NAME-controller:$VERSION
DIST_FILE=gitbackup.yaml

cd "$PROJECT_ROOT"

make kustomize

cd config/manager && "$PROJECT_ROOT/bin/kustomize" edit set image controller="$IMG"
cd "$PROJECT_ROOT" && "$PROJECT_ROOT/bin/kustomize" build config/default > $DIST_FILE

0 comments on commit 7085018

Please sign in to comment.