-
Notifications
You must be signed in to change notification settings - Fork 18
96 lines (81 loc) · 2.81 KB
/
cd.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
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
name: CD
concurrency:
group: "pages"
cancel-in-progress: true
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main
permissions: {}
jobs:
publish-latest-update-site:
name: Publish Latest Update Site # (from main branch only)
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# we are very restrictive when this runs, i.e. only on main, only on success and only with the bazel-eclipse repository (not on forks)
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event != 'pull_request' &&
github.repository == 'salesforce/bazel-eclipse' &&
github.ref == 'refs/heads/main'
# set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download p2 Repository
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: p2-repository
path: bazel-eclipse-latest
skip_unpack: true
- name: Download Products
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: products
path: bazel-eclipse-latest
skip_unpack: true
- name: Extract downloaded artifacts
run: |
unzip bazel-eclipse-latest/p2-repository.zip -d bazel-eclipse-latest
unzip bazel-eclipse-latest/products.zip -d bazel-eclipse-latest
rm bazel-eclipse-latest/products.zip
- name: Assemble pages folder
run: |
mkdir -p _site/latest
cp -rfv bazel-eclipse-latest/* _site/latest/
cp -rfv .github/pages/* _site/
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Display structure of the site
run: ls -R _site/
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy Update Site 🚀
id: deployment
uses: actions/deploy-pages@v4
- name: Trigger VS Code Extension publish workflow
uses: actions/github-script@v7
with:
github-token: ${{ secrets.BAZEL_VSCODE_JAVA_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'salesforce',
repo: 'bazel-vscode-java',
workflow_id: 'publish.yml',
ref: 'main',
inputs: {
releaseChannel: 'edge'
}
});