-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.59 KB
/
static.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
# Simple workflow for deploying static content to GitHub Pages
name: update debiancn.org index page to Pages
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '00 23 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
update_files:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
repository: debiancn/debiancn-home
- name: apt update
run: sudo apt update
- name: install xsltproc
run: sudo apt install xsltproc
- name: generate index page
run: make
- name: Archive new page
uses: actions/upload-artifact@v3
with:
name: new-index-page
path: |
index.html
privacy-terms.html
check:
needs: update_files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: new-index-page
- run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git status
git commit -m "action auto update" || echo "nothing to update"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}