Skip to content

Commit

Permalink
avoiding force push as it breaks DNS link
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex committed Dec 12, 2023
1 parent 5b7fdda commit 66385e5
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 13 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MkDocs Build + Deploy
name: mkdocs_build_deploy

on:
push:
Expand Down Expand Up @@ -28,14 +28,37 @@ jobs:
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
# git branch --delete production
git checkout -b production # Replace 'documentation' with the desired branch name
# git checkout production
find . -type f ! -path './site*' ! -path './.*' -exec echo {} +
find . -type f ! -path './site*' ! -path './.*' -exec rm -f {} +
rm -rf docs
mv site docs
touch .nojekyll
# git checkout -b production
# find . -type f ! -path './site*' ! -path './.*' -exec echo {} +
# find . -type f ! -path './site*' ! -path './.*' -exec rm -f {} +
# rm -rf docs
# mv site docs
# touch .nojekyll
# git add .
# git commit -m "Content update"
git fetch --all
# Check if there are any local changes
if [ -n "$(git status --porcelain)" ]; then
# If there are changes, commit them
git add .
git commit -m "Committing local changes before switching branches"
else
echo "No local changes to commit."
fi

git checkout production

# Remove files and directories from the production branch
git rm -r --ignore-unmatch */*

git checkout main -- site


# git mv site docs
git add -A
git commit -m "Content update"
git push --force origin production

git push
38 changes: 38 additions & 0 deletions .github/workflows/staticpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy static content to Pages

on:
workflow_run:
workflows:
- mkdocs_build_deploy
types:
- completed

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: production # Specify the branch you want to deploy
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'site' # Specify the folder you want to deploy
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# mipcvs-wiki
[![pages-build-deployment](https://github.com/WCRP-CMIP/mipcvs-wiki/actions/workflows/pages/pages-build-deployment/badge.svg?branch=production)](https://github.com/WCRP-CMIP/mipcvs-wiki/actions/workflows/pages/pages-build-deployment)
[![MkDocs Build + Deploy](https://github.com/WCRP-CMIP/mipcvs-wiki/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/WCRP-CMIP/mipcvs-wiki/actions/workflows/deploy.yml)
[![Check markdown links](https://github.com/WCRP-CMIP/mipcvs-wiki/actions/workflows/LinkChecker.yml/badge.svg)](https://github.com/WCRP-CMIP/mipcvs-wiki/actions/workflows/LinkChecker.yml)

Contents for the MIPCVs wiki. See wiki.mipcvs.com

Contents for the MIPCVs wiki. See [wiki.mipcvs.dev](https://wiki.mipcvs.dev/)
---


## Editing the documentation.
Expand Down
6 changes: 5 additions & 1 deletion docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
-ms-transform: scale(0.7111);
transform: scale(0.7111);
/* width:100vw */
/* position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%); */
}

.md-header {
Expand All @@ -33,4 +37,4 @@ body{
top:0;
width:100vw;
position:absolute;
}
}

0 comments on commit 66385e5

Please sign in to comment.