-
Notifications
You must be signed in to change notification settings - Fork 14
76 lines (65 loc) · 2.05 KB
/
push-to-another.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
name: push to another
# - 'kong-gateway-operator-v[0-9]+.[0-9]+.[0-9]+'
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
description: The version to release (e.g. v1.2.3)
required: true
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- uses: ncipollo/release-action@v1
with:
body: stuff
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.tag }}
commit: ${{ github.sha }}
prerelease: ${{ github.event.inputs.prerelease }}
copy:
runs-on: ubuntu-latest
# needs:
# - publish-release
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: strip v from tag
run: |
TAG=${{ github.event.inputs.tag }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: pmalek/bundle-redhat-certified'
token: ${{ secrets.PAT_GITHUB }}
path: bundle-redhat-certified
ref: main
- name: create and push branch
run: |
cd bundle-redhat-certified
git checkout kong-gateway-operator-${{ github.event.inputs.tag }}
git push origin kong-gateway-operator-${{ github.event.inputs.tag }}
- name: bundle
run: VERSION=${{ env.VERSION }} make bundle.redhat-certified
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.PAT_GITHUB }}
with:
source-directory: 'bundle/redhat-certified'
destination-github-username: 'pmalek'
destination-repository-name: 'bundle-redhat-certified'
user-email: [email protected]
target-branch: kong-gateway-operator-${{ github.event.inputs.tag }}
target-directory: operators/kong-gateway-operator-${{ github.event.inputs.tag }}