forked from Freetz/freetz
-
-
Notifications
You must be signed in to change notification settings - Fork 107
62 lines (53 loc) · 1.73 KB
/
generate_ftp.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
name: generate_ftp
on:
push:
branches: [ master ]
paths:
- '.github/workflows/generate_ftp.yml'
- 'docs/ftp/generate.sh'
schedule:
- cron: '00 15 * * 1-5'
workflow_dispatch:
jobs:
build:
container:
# image: ubuntu:20.04
# image: freetzng/generate
image: ghcr.io/freetz-ng/generate
runs-on: ubuntu-latest
if: github.repository == 'freetz-ng/freetz-ng'
steps:
# - name: update
# run: apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade
#
# - name: install
# run: |
# DEBIAN_FRONTEND=noninteractive apt-get -y install \
# git locales wget
#
# - name: locale
# run: locale-gen en_US.utf8 && locale-gen de_DE.UTF-8 && update-locale
- name: clone
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
umask 0022
git config --global --add safe.directory $GITHUB_WORKSPACE
git clone https://github-actions:$GITHUB_TOKEN@${GITHUB_SERVER_URL##*/}/$GITHUB_REPOSITORY.git $GITHUB_WORKSPACE --branch $GITHUB_REF_NAME
- name: generate
run: |
export LANG=en_US.utf8
docs/ftp/generate.sh
- name: commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git pull
git add .
git status
git config --local user.name github-actions
git config --local user.email [email protected]
git diff --cached --quiet && exit 0 || git commit -m "ftp: automatic update"
git config --local credential.helper '!x() { echo "password=$GITHUB_TOKEN"; };x'
git push origin $GITHUB_REF_NAME