@@ -53,3 +53,107 @@ jobs:
5353 cache-from : type=gha
5454 cache-to : type=gha,mode=max
5555 platforms : linux/amd64,linux/arm64
56+
57+
58+
59+ # name: Build and Push Docker Images
60+
61+ # on:
62+ # push:
63+ # branches: [main]
64+ # tags:
65+ # - 'v*.*.*'
66+
67+ # env:
68+ # REGISTRY: ghcr.io
69+ # IMAGE_NAME: ${{ github.repository }}
70+
71+ # jobs:
72+ # build:
73+ # runs-on: ubuntu-latest
74+ # permissions:
75+ # contents: read
76+ # packages: write
77+
78+ # steps:
79+ # - name: 📥 Checkout code
80+ # uses: actions/checkout@v4
81+
82+ # - name: 🔧 Set up Docker Buildx
83+ # uses: docker/setup-buildx-action@v3
84+
85+ # - name: 🔐 Login to GitHub Container Registry
86+ # uses: docker/login-action@v3
87+ # with:
88+ # registry: ${{ env.REGISTRY }}
89+ # username: ${{ github.actor }}
90+ # password: ${{ secrets.GITHUB_TOKEN }}
91+
92+ # - name: 🏷️ Extract metadata
93+ # id: meta
94+ # uses: docker/metadata-action@v5
95+ # with:
96+ # images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
97+ # tags: |
98+ # type=ref,event=branch
99+ # type=semver,pattern={{version}}
100+ # type=semver,pattern={{major}}.{{minor}}
101+ # type=sha,prefix={{branch}}-
102+ # type=raw,value=latest,enable={{is_default_branch}}
103+ # type=sha
104+
105+ # - name: 🐳 Build and push Docker image
106+ # uses: docker/build-push-action@v5
107+ # with:
108+ # context: .
109+ # push: true
110+ # tags: ${{ steps.meta.outputs.tags }}
111+ # labels: ${{ steps.meta.outputs.labels }}
112+ # cache-from: type=gha
113+ # cache-to: type=gha,mode=max
114+ # platforms: linux/amd64,linux/arm64
115+
116+ # update-infra:
117+ # needs: build
118+ # runs-on: ubuntu-latest
119+ # if: github.ref == 'refs/heads/main'
120+
121+ # steps:
122+ # - name: 📥 Checkout infra repo
123+ # uses: actions/checkout@v4
124+ # with:
125+ # repository: nesohq/infra-nesohq-landing
126+ # token: ${{ secrets.INFRA_PAT }}
127+ # path: infra
128+
129+ # - name: 🔄 Update image tag
130+ # run: |
131+ # cd infra
132+ # sed -i "s|image: ghcr.io/nesohq/nesohq:.*|image: ghcr.io/nesohq/nesohq:sha-${GITHUB_SHA::7}|" k8s/deployment.yaml
133+
134+ # - name: 📝 Create Pull Request
135+ # uses: peter-evans/create-pull-request@v6
136+ # with:
137+ # token: ${{ secrets.INFRA_PAT }}
138+ # path: infra
139+ # branch: update-image-${{ github.sha }}
140+ # commit-message: "Update landing image to sha-${{ github.sha }}"
141+ # title: "🚀 Update landing image to ${{ github.sha }}"
142+ # body: |
143+ # ## Image Update
144+
145+ # **Commit:** ${{ github.sha }}
146+ # **Image:** `ghcr.io/nesohq/nesohq:sha-${{ github.sha }}`
147+ # **Triggered by:** ${{ github.event.head_commit.message }}
148+
149+ # ### Changes
150+ # - Updated deployment image tag
151+
152+ # ### Testing
153+ # ```bash
154+ # kubectl apply -f k8s/deployment.yaml
155+ # kubectl rollout status deployment/landing -n nesohq-landing
156+ # ```
157+ # labels: |
158+ # automated
159+ # deployment
0 commit comments