-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (48 loc) · 1.39 KB
/
ci-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: CI Main
on:
push:
branches: ["main"]
env:
VERSION: v0.2.4
REPO: vcr.vngcloud.vn/81-vks-public
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: vngcloud-ingress-controller
- image: vngcloud-controller-manager
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Log in to the GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the vCR
uses: docker/login-action@v3
with:
registry: vcr.vngcloud.vn
username: ${{ secrets.VCR_USER_PRO }}
password: ${{ secrets.VCR_PASSWORD_PRO }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ env.VERSION }}
platforms: linux/amd64
outputs: type=registry
tags: |
ghcr.io/vngcloud/${{ matrix.image }}:${{ github.sha }}
${{ env.REPO }}/${{ matrix.image }}:${{ github.sha }}
${{ env.REPO }}/${{ matrix.image }}:${{ env.VERSION }}
target: ${{ matrix.image }}