fix: wildcard cname wasn't correct in k8s #19
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
name: release | |
on: | |
push: | |
branches: | |
- main | |
env: | |
SERVER_DOCKER_IMAGE_NAME: ghcr.io/sunggun-yu/dnsq-server | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
outputs: | |
releases_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- id: release | |
uses: googleapis/release-please-action@v4 | |
with: | |
release-type: go | |
goreleaser: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
outputs: | |
metadata: ${{ steps.goreleaser.outputs.metadata }} | |
needs: release-please | |
if: ${{ needs.release-please.outputs.releases_created }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '^1.22' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- id: app-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.PRIVATE_KEY }} | |
owner: ${{ github.repository_owner }} | |
- name: Docker Login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- id: goreleaser | |
name: Run GoReleaser | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
update-manifest: | |
runs-on: ubuntu-latest | |
needs: [release-please, goreleaser] | |
permissions: | |
contents: write | |
if: ${{ needs.release-please.outputs.releases_created }} | |
steps: | |
- name: Install Kustomization | |
run: | | |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash | |
sudo mv kustomize /usr/local/bin/ | |
- id: app-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.PRIVATE_KEY }} | |
owner: ${{ github.repository_owner }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.app-token.outputs.token }} | |
fetch-depth: 0 | |
- name: Set git identity | |
run: | | |
git config --global user.name "${{ steps.app-token.outputs.app-slug }}" | |
git config --global user.email "${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" | |
- name: Update manifest and push | |
run: | | |
TAG_NAME=${{ needs.release-please.outputs.tag_name }} | |
TAG_NAME=${TAG_NAME#v} | |
cd manifests/kustomization | |
kustomize edit set image dnsq-server=$SERVER_DOCKER_IMAGE_NAME:$TAG_NAME | |
cat kustomization.yaml | |
- name: Build manifest | |
run: | | |
# build manifests | |
kustomize build manifests/kustomization > manifests/install.yaml | |
cat manifests/install.yaml | |
- name: Push changes | |
run: | | |
git add manifests | |
git commit -m "[skip ci] chore: release manifest for ${{ needs.release-please.outputs.tag_name }}" | |
git push origin $GITHUB_REF_NAME |