-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (42 loc) · 1.43 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
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
build:
# grumble
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#github-hosted-runners
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: actions/setup-python@v2
- name: Build the site
run: |
# Set up a virtualenv
python -m venv venv
source venv/bin/activate
python setup.py develop
# Build the sites
./asknot-ng.py templates/index.html questions/rh-impact.yml l10n/fedora/locale --theme rh-impact
- name: Swap out code for build output
run: |
# Hide the build directory, destroy everything else, and unpack the build contents
mv build .build
git rm -rf .
mv .build/* .
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add static/ en/ index.html
git commit -m "Automated update"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: build
force: true