-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (95 loc) · 2.74 KB
/
Copy pathcd-rpm-packages.yml
File metadata and controls
109 lines (95 loc) · 2.74 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This is a basic workflow to help you get started with Actions
name: Sign and Distribute RPM Packages
# Controls when the workflow will run
on:
workflow_call:
inputs:
ENVIRONMENT:
required: false
type: string
RUNNER:
required: false
default: ubuntu-latest
type: string
TARGET_PATH:
required: true
default: ''
type: string
TARGET_FOLDER:
required: true
default: ''
type: string
GPG_NAME:
required: true
default: ''
type: string
secrets:
GPG_KEY:
required: true
GPG_CERT:
required: true
TELEPORT_TOKEN:
required: true
PROXY_URL:
required: true
HOSTNAME:
required: true
USERNAME:
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
# The type of runner that the job will run on
runs-on: ${{ inputs.RUNNER }}
name: Sign And Distribute Packages
environment: ${{ inputs.ENVIRONMENT }}
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout actions
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
path: actions
- uses: actions/download-artifact@v6
with:
name: rpm-artifact
- name: GPG Key Secret File
uses: ttd2089/secret-file-action@main
id: gpg-key-secret
with:
secret: ${{ secrets.GPG_KEY }}
b64-decode: true
- name: GPG Key Secret File
uses: ttd2089/secret-file-action@main
id: gpg-cert-secret
with:
secret: ${{ secrets.GPG_CERT }}
b64-decode: true
- name: Set UUID
id: generate-uuid
uses: filipstefansson/uuid-action@v1
- name: Sign RPM
uses: signalwire/sign-rpm-packages-action@main
with:
gpgkey_file: ${{ steps.gpg-key-secret.outputs.file }}
gpgcert_file: ${{ steps.gpg-cert-secret.outputs.file }}
gpg_name: ${{inputs.GPG_NAME }}
target_path: ${{ inputs.TARGET_PATH }}
target_folder: ${{ inputs.TARGET_FOLDER }}
tar_name: ${{ steps.generate-uuid.outputs.uuid }}
rpm_path: .
- name: Copy files to remote host
uses: ./actions/.github/actions/teleport
with:
FILES: ${{ steps.generate-uuid.outputs.uuid }}.tar.gz
EXEC_COMMANDS: sudo tar -zxvf /tmp/${{ steps.generate-uuid.outputs.uuid }}.tar.gz -C /
FILES_FOLDER: /tmp
env:
USERNAME: ${{ secrets.USERNAME }}
HOSTNAME: ${{ secrets.HOSTNAME }}
PROXY_URL: ${{ secrets.PROXY_URL }}
TOKEN: ${{ secrets.TELEPORT_TOKEN }}