-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (42 loc) · 1.51 KB
/
deploy.yml
File metadata and controls
49 lines (42 loc) · 1.51 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
name: "Sync and deploy"
on:
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
with:
fetch-depth: 1
path: 'security-code-scan.github.io'
- name: Checkout security-code-scan
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
repository: 'security-code-scan/security-code-scan'
path: 'security-code-scan'
- name: build
shell: pwsh
run: |
$ErrorActionPreference = "Stop";
python security-code-scan/website/generate_static_website.py
Copy-Item security-code-scan/website/out_site/readme.md security-code-scan.github.io/README.md -Force
Copy-Item security-code-scan/website/images/* security-code-scan.github.io/images/ -Force
cd security-code-scan.github.io
git config --global user.email "octokit@github.com"
git config --global user.name "Octokit"
$ErrorActionPreference = "Continue";
if (-not (git status -s)) {
Write-Host "No changes to commit"
} else {
git add .
git commit -a -m "Automatic merge with https://github.com/security-code-scan/security-code-scan/tree/vs2019/website"
if($LastExitCode -eq 0) {
Write-Host "Pushing to the website repo"
git push
}
}