Skip to content

Commit

Permalink
Merge pull request #14 from wpiet/ci-fix-test
Browse files Browse the repository at this point in the history
test gha
  • Loading branch information
wpiet authored Aug 8, 2024
2 parents b516342 + da24639 commit be09788
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
##

name: Deploy Site
on: push
Expand All @@ -29,28 +29,33 @@ jobs:
- uses: actions/checkout@v3
with:
ref: master
fetch-depth: 2

- name: Check For Content Changes
id: check_changes
run: |
latest_commit=$(git rev-parse HEAD)
previous_commit=$(git rev-parse HEAD~1)
content_changed=$(git diff --name-only $previous_commit $latest_commit | grep -E '\.(html|css|js|py|md|rst)$')
content_changed=$(git diff --name-only $previous_commit $latest_commit | grep -E '\.(html|css|js|py|md|rst)$') || true
if [ -z "$content_changed" ]; then
echo "No relevant changes detected."
exit 0
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "Relevant changes detected."
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Install Dependencies
if: steps.check_changes.outputs.changed == 'true'
run: |
sudo apt-get update
sudo apt-get install -y doxygen tzdata
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Project
if: steps.check_changes.outputs.changed == 'true'
run: |
cd ..
git clone https://github.com/apache/mynewt-documentation
Expand All @@ -60,15 +65,19 @@ jobs:
git clone https://github.com/apache/mynewt-newtmgr
- name: Build Site
if: steps.check_changes.outputs.changed == 'true'
run: ./build.py

- name: Fetch Deployment Branch
if: steps.check_changes.outputs.changed == 'true'
run: git fetch origin asf-site:asf-site

- name: Deploy Site
if: steps.check_changes.outputs.changed == 'true'
run: ./deploy.sh build

- name: Create Pull Request
if: steps.check_changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions custom-theme/quick-start.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
{% endblock %}
</div>
</div>

</div>

0 comments on commit be09788

Please sign in to comment.