Melika Kheirieh commited on
Commit
797db01
·
1 Parent(s): 1fa9a31

ci: add initial CD workflow skeleton

Browse files
Files changed (2) hide show
  1. .coverage +0 -0
  2. .github/workflows/cd.yml +60 -0
.coverage ADDED
Binary file (53.2 kB). View file
 
.github/workflows/cd.yml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CD - Build & Push Docker Image
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ release:
7
+ types: [published]
8
+
9
+ jobs:
10
+ build-and-push:
11
+ runs-on: ubuntu-latest
12
+
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+
17
+ env:
18
+ REGISTRY: ghcr.io
19
+ IMAGE_NAME: ${{ github.repository }}
20
+
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Set up QEMU
26
+ uses: docker/setup-qemu-action@v3
27
+
28
+ - name: Set up Buildx
29
+ uses: docker/setup-buildx-action@v3
30
+
31
+ - name: Log in to GHCR
32
+ uses: docker/login-action@v3
33
+ with:
34
+ registry: ghcr.io
35
+ username: ${{ github.actor }}
36
+ password: ${{ secrets.GITHUB_TOKEN }}
37
+
38
+ - name: Extract metadata (tags, labels)
39
+ id: meta
40
+ uses: docker/metadata-action@v5
41
+ with:
42
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43
+ tags: |
44
+ type=raw,value=latest,enable={{is_default_branch}}
45
+ type=ref,event=branch
46
+ type=ref,event=tag
47
+ type=semver,pattern={{version}}
48
+ type=sha
49
+
50
+ - name: Build and push
51
+ uses: docker/build-push-action@v6
52
+ with:
53
+ context: .
54
+ file: ./Dockerfile
55
+ push: true
56
+ platforms: linux/amd64
57
+ tags: ${{ steps.meta.outputs.tags }}
58
+ labels: ${{ steps.meta.outputs.labels }}
59
+ cache-from: type=gha
60
+ cache-to: type=gha,mode=max