-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (84 loc) · 3.17 KB
/
release.yaml
File metadata and controls
88 lines (84 loc) · 3.17 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
name: Release Builder
on:
push:
branches:
- 'release/**'
permissions:
actions: write
contents: write
id-token: write
pull-requests: write
concurrency:
group: "documentation"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
deployment:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
token: '${{ github.token }}'
- name: "Prepare Documentation Builder"
run: |
./doc-builder build-image
- name: "Adjust Release Name: ${{ github.ref_name }}"
env:
name: "${{ github.ref_name }}"
run: |
echo "RELEASE_NAME=$(echo ${name} | sed -e 's/.*\///g')" >> $GITHUB_ENV
- name: "Lock sbcli/sbcli version"
run: |
[ -f ./scripts/sbcli.lock ] || echo "${{ env.RELEASE_NAME }}" > ./scripts/sbcli.lock
- name: "Prepare Documentation Deployment: ${{ env.RELEASE_NAME }}"
run: |
./doc-builder update-repositories
./doc-builder deploy ${{ env.RELEASE_NAME }}
- name: "Create Version Tag: ${{ env.RELEASE_NAME }}"
run: |
git config --global --add safe.directory $PWD
git config user.name github-actions
git config user.email github-actions@github.com
git add deployment
git add scripts/sbcli.lock
git commit -m "Auto-Build: ${RELEASE_NAME}"
git tag ${RELEASE_NAME}
git rm scripts/sbcli.lock
git commit -m "Auto-Build: Post ${RELEASE_NAME}"
git push --all
git push --tags
rm ./deployment/versions.json
rm ./deployment/latest
- name: "Upload Documentation"
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.ftp_server }}
username: ${{ secrets.ftp_username }}
password: ${{ secrets.ftp_password }}
server-dir: /
local-dir: ./deployment/
- name: "Updating Latest"
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ secrets.ssh_server }}
port: ${{ secrets.ssh_port }}
username: ${{ secrets.ssh_username }}
key: ${{ secrets.ssh_key }}
script: |
./update-docs.sh ${{ env.RELEASE_NAME }}
- name: "Create Pull Request for ${{ github.event.repository.default_branch }}"
id: open-pr
run: |
gh pr create --title "[Automated] Merge ${{ env.RELEASE_NAME }} into ${{ github.event.repository.default_branch }}" --body "Merge ${{ env.RELEASE_NAME }} into ${{ github.event.repository.default_branch }}" --assignee ${{ github.actor }} --reviewer ${{ github.actor }} --base ${{ github.event.repository.default_branch }}
echo "pr_number=$(gh pr list --state open --json number --limit 1 | jq -r '.[0].number')" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ github.token }}
- name: "Enable Auto-Merge PR to ${{ github.event.repository.default_branch }}"
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: "${{ github.token }}"
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}
merge-method: merge