-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (69 loc) · 2.09 KB
/
deploy-to-github.yml
File metadata and controls
76 lines (69 loc) · 2.09 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
name: Deploy To GitHub
on:
workflow_call:
secrets:
access-token:
description: 'A token passed from the caller workflow'
required: true
inputs:
repository:
description: "Specify a maven-packages repository"
required: true
type: string
module:
description: "Specify the module to be published"
required: false
type: string
is_release:
default: false
required: false
type: boolean
jobs:
github-package:
if: ${{ inputs.is_release }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Deploy to GitHub Package 🚀
run: |
if [ ! ${{ inputs.module }} ]; then
mvn clean deploy -DCI_RELEASE_URL=${{ env.CI_GITHUB_URL }}
else
mvn clean deploy -am -pl ${{ inputs.module }} -DCI_RELEASE_URL=${{ env.CI_GITHUB_URL }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_GITHUB_URL: "https://maven.pkg.github.com/${{ github.repository }}"
github-repository:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
fetch-depth: 0
token: ${{ secrets.access-token }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: plugin-source
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Deploy To Local
run: cd plugin-source; mvn clean deploy -DCI_RELEASE_URL=${{ env.CI_LOCAL_URL }}
env:
CI_LOCAL_URL: "file://${{ github.workspace }}"
- name: Remove Source Code
run: rm -rf plugin-source
- name: Deploy To GitHub Repository 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: ${{ inputs.repository }}
branch: main
folder: .
token: ${{ secrets.access-token }}