archive: dm docs (#571) #149
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Preview | |
on: | |
push: | |
branches: ["master"] | |
paths-ignore: | |
- ".github/**" | |
workflow_dispatch: | |
concurrency: ci-prev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Automatically update submodule | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: "preview" | |
- name: Init git info | |
run: | | |
git status | |
git config user.name github-actions | |
git config user.email [email protected] | |
- name: Git reset to master branch | |
run: | | |
git fetch | |
git reset --hard origin/master | |
- name: Update submodule | |
id: submodule | |
run: | | |
git submodule init | |
echo "submodule_sha_origin=$(git submodule status | awk '{print $1}' | sed -r 's/[+-]+//g')" >> $GITHUB_OUTPUT | |
git submodule update --remote | |
echo "submodule_sha=$(git submodule status | awk '{print $1}' | sed -r 's/[+-]+//g')" >> $GITHUB_OUTPUT | |
echo "git_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
echo "build_date=$(date)" >> $GITHUB_OUTPUT | |
- name: Git commit and push submodules update | |
run: | | |
git add . | |
if [[ -z $(git status -s) ]] | |
then | |
git status | |
else | |
git commit -m "update submodules" | |
fi | |
git push -f |