Skip to content

Commit c1cc05a

Browse files
committed
Add CI/CD pipeline configuration
1 parent 5059051 commit c1cc05a

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Log in to GHCR
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Extract metadata for Docker
25+
id: meta
26+
uses: docker/metadata-action@v5
27+
with:
28+
images: ghcr.io/udl-tf/united-api
29+
tags: |
30+
type=ref,event=branch
31+
type=semver,pattern={{version}}
32+
type=semver,pattern={{major}}.{{minor}}
33+
type=sha
34+
type=raw,value=build-${{ github.run_number }}
35+
type=raw,value=latest,enable={{is_default_branch}}
36+
- name: Build and push
37+
uses: docker/build-push-action@v5
38+
with:
39+
file: Dockerfile
40+
context: .
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)