-
Notifications
You must be signed in to change notification settings - Fork 17
43 lines (38 loc) · 1.21 KB
/
release.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
on:
release:
types: [published]
name: tag
permissions:
contents: write
id-token: write
jobs:
publish-rke2-upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Change Tag
run: |
echo "GIT_TAG=$(echo "${{ github.ref_name }}" | sed -e 's/+/-/g')" >> "$GITHUB_ENV"
- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
- name: Login to Container Registry
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Build container image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: rancher/rke2-upgrade:${{ env.GIT_TAG }}
file: Dockerfile
platforms: linux/amd64
build-args: |
TAG=${{ github.ref_name }}
ARCH=amd64