-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (31 loc) · 1014 Bytes
/
stable-dir.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
name: Update Stable Directory
on:
push:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Get the latest stable version number
id: get-latest-version
run: echo "::set-output name=version::$(cat latest_release.txt)"
- name: Delete current "stable" directory
run: |
git rm -r stable
- name: Copy latest stable version content to "stable" directory
run: |
mkdir stable
cp -a ${{ steps.get-latest-version.outputs.version }}/* stable
- name: Commit and push
run: |
git add -A
git diff-index --quiet HEAD || ( git commit -m "Update stable dir" && git push )