Skip to content

Commit

Permalink
ci: setup GHA
Browse files Browse the repository at this point in the history
Signed-off-by: STRRL <im@strrl.dev>
  • Loading branch information
STRRL committed Jun 13, 2023
1 parent 32b65ce commit 03133ef
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-container-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Latest Docker Image

on:
workflow_dispatch: {}
push:
tags:
- v*

jobs:
build:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: "Extract Version"
id: extract_version
run: |
GIT_TAG=${GITHUB_REF##*/}
VERSION=${GIT_TAG##v}
echo "::set-output name=version::$(echo $VERSION)"
- uses: actions/checkout@v2
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
run: make image
- name: Push docker image to ghcr.io
env:
VERSION: ${{ steps.extract_version.outputs.version }}
run: |
docker tag ghcr.io/strrl/cloudflare-tunnel-ingress-controller:latest ghcr.io/strrl/cloudflare-tunnel-ingress-controller:$VERSION
docker push ghcr.io/strrl/cloudflare-tunnel-ingress-controller:$VERSION
31 changes: 31 additions & 0 deletions .github/workflows/release-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release helm chart

on:
push:
tags:
- "v*"

permissions: read-all

jobs:
release-chart:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: "Extract Version"
id: extract_version
run: |
GIT_TAG=${GITHUB_REF##*/}
VERSION=${GIT_TAG##v}
echo "::set-output name=version::$(echo $VERSION)"
- name: Publish Helm chart
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.HELM_TOKEN }}
charts_dir: helm
charts_url: https://helm.strrl.dev
owner: strrl
repository: helm.strrl.dev
branch: gh-pages
app_version: ${{ steps.extract_version.outputs.version }}
chart_version: ${{ steps.extract_version.outputs.version }}
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.PHONY: dev
dev:
skaffold dev --namespace cloudflare-tunnel-ingress-controller-dev

.PHONY: image
image:
DOCKER_BUILDKIT=1 docker build -t ghcr.io/strrl/cloudflare-tunnel-ingress-controller -f ./image/cloudflare-tunnel-ingress-controller/Dockerfile .
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ TLDR; This project simplifies exposing Kubernetes services to the internet easil

- You should have a Cloudflare account and a domain configured on Cloudflare.
- Create a Cloudflare API token with the following:
- Zone:Zone:Read
- Zone:DNS:Edit
- Account:Cloudflare Tunnel:Edit
- `Zone:Zone:Read`
- `Zone:DNS:Edit`
- `Account:Cloudflare Tunnel:Edit`
- Fetch the Account ID from the Cloudflare dashboard, follow the instructions [here](https://developers.cloudflare.com/fundamentals/get-started/basic-tasks/find-account-and-zone-ids/).
- Bootstrap a minikube cluster

Expand Down
4 changes: 2 additions & 2 deletions hack/dev/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ spec:
secretName: cloudflare-api
containers:
- name: cloudflare-tunnel-ingress-controller
image: ghcr.io/strrl/cloudflare-tunnel-ingress-controller
image: cloudflare-tunnel-ingress-controller
command:
- cloudflare-tunnel-ingress-controller
- -v=10
Expand Down Expand Up @@ -132,4 +132,4 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
serviceAccountName: cloudflare-tunnel-ingress-controller
serviceAccountName: cloudflare-tunnel-ingress-controller
3 changes: 1 addition & 2 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: cloudflare-tunnel-ingress-controller
build:
artifacts:
- image: ghcr.io/strrl/cloudflare-tunnel-ingress-controller
- image: cloudflare-tunnel-ingress-controller
docker:
dockerfile: image/cloudflare-tunnel-ingress-controller/Dockerfile
noCache: false
Expand All @@ -17,4 +17,3 @@ manifests:
- hack/dev/ns.yaml
- hack/dev/cloudflare-api.yaml
- hack/dev/deployment.yaml

0 comments on commit 03133ef

Please sign in to comment.