Skip to content

Commit dbff0a7

Browse files
Add workflow
1 parent e14b849 commit dbff0a7

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and deploy the service
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v2
15+
16+
- name: Log into registry
17+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
18+
with:
19+
registry: ${{ secrets.PRIVATE_REGISTRY_URL }}
20+
username: ${{ secrets.PRIVATE_REGISTRY_USER }}
21+
password: ${{ secrets.PRIVATE_REGISTRY_PW }}
22+
23+
- name: Get commit SHA for Docker image tag
24+
id: sha
25+
run: echo "value=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
26+
27+
- name: Extract Docker metadata for the server image
28+
id: meta
29+
uses: docker/metadata-action@v4
30+
with:
31+
images: ${{ secrets.PRIVATE_REGISTRY_URL }}/panini
32+
tags: |
33+
type=schedule
34+
type=ref,event=branch
35+
type=ref,event=tag
36+
type=ref,event=pr
37+
type=raw,value=sha-${{ steps.sha.outputs.value }}
38+
39+
- name: Build and push the Docker image
40+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}
46+
cache-to: type=gha
47+
cache-from: type=gha
48+
49+
- name: Trigger deployment
50+
if: false
51+
uses: aurelien-baudet/workflow-dispatch@v2
52+
with:
53+
token: ${{ secrets.DEPLOYMENT_PAT }}
54+
workflow: Bump Service
55+
inputs: '{"service": "panini", "tag": "sha-${{ steps.sha.outputs.value }}"}'
56+
repo: TKOaly/tko-aly-k8s-configs
57+
ref: main

0 commit comments

Comments
 (0)