-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (76 loc) · 2.56 KB
/
publish.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Release
# RELEASE="v1.0.9" bash -c 'git tag $RELEASE && git push origin $RELEASE'
on:
push:
tags:
- "v*" # Triggers on version tags, e.g., v1.0.0
env:
REPO: vcr.vngcloud.vn/81-vks-public
jobs:
build_package:
runs-on: ubuntu-latest
permissions:
contents: write
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: Debug
run: echo ${{ github.ref_name }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ github.ref_name }}
platforms: linux/amd64
outputs: type=registry
tags: |
ghcr.io/vngcloud/vngcloud-ingress-controller:${{ github.sha }}
ghcr.io/vngcloud/vngcloud-ingress-controller:${{ github.ref_name }}
${{ env.REPO }}/vngcloud-ingress-controller:${{ github.sha }}
${{ env.REPO }}/vngcloud-ingress-controller:${{ github.ref_name }}
target: vngcloud-ingress-controller
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ github.ref_name }}
platforms: linux/amd64
outputs: type=registry
tags: |
ghcr.io/vngcloud/vngcloud-controller-manager:${{ github.sha }}
ghcr.io/vngcloud/vngcloud-controller-manager:${{ github.ref_name }}
${{ env.REPO }}/vngcloud-controller-manager:${{ github.sha }}
${{ env.REPO }}/vngcloud-controller-manager:${{ github.ref_name }}
target: vngcloud-controller-manager
create_release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "${{ github.ref_name }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ github.ref_name }}" \
--generate-notes