-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (48 loc) · 1.82 KB
/
build.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
name: Build/Deploy
permissions:
contents: write
on:
workflow_dispatch: {}
push:
branches:
- main
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 12 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Rebuild the site
run: |
git clone https://github.com/openstack-charmers/charmed-openstack-info
sudo snap install --channel latest/edge charmhub-lp-tool
git rm report/builds/*.html || true
git rm report/charmhub/*.html || true
echo "${{ secrets.LP_CREDENTIALS }}" | base64 -d > lp-credentials.txt
export LP_CREDENTIALS_FILE=$(pwd)/lp-credentials.txt
./gen-reports.sh
env:
# Generate a valid a macaroon with running:
# $ charmcraft login --export=secrets.auth --permission=account-view-packages --permission=package-view --ttl=$((265 * 24 60)) # 1 year
CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }}
- name: Commit changes to data file
run: |
set -euo pipefail
git remote set-url origin https://x-access-token:"$GITHUB_TOKEN"@github.com/"$GITHUB_REPOSITORY".git
git config --global user.email "[email protected]"
git config --global user.name "actions"
git checkout $GITHUB_REF_NAME
git add report/
git commit -m "data: refresh release reports" && git push --set-upstream origin $GITHUB_REF_NAME || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./report