This is an automated email from the ASF dual-hosted git repository. bmarwell pushed a commit to branch staging-action in repository https://gitbox.apache.org/repos/asf/shiro-site.git
commit 1f2d34ccb56db94a6b592e8e3ac506acdc679a6a Author: Benjamin Marwell <[email protected]> AuthorDate: Sun Mar 6 21:09:10 2022 +0100 add staging action --- .github/workflows/mandatory_files.yml | 2 ++ .github/workflows/maven.yml | 5 ++--- .github/workflows/{maven.yml => staging.yml} | 33 +++++++++++++++++++++------- src/site/assets/robots.staging.txt | 15 +++++++++++++ 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/.github/workflows/mandatory_files.yml b/.github/workflows/mandatory_files.yml index 408db45..9abf62f 100644 --- a/.github/workflows/mandatory_files.yml +++ b/.github/workflows/mandatory_files.yml @@ -32,6 +32,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + persist-credentials: false - run: file assets/images/apache-shiro-logo.png shell: bash diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6a62e60..e872148 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -30,9 +30,8 @@ jobs: steps: - uses: actions/checkout@v2 - - - run: sed -i.bak 's/site.host=.*/site.host=https:\/\/shiro-jbake.staged.apache.org\//g' jbake.properties && rm jbake.properties.bak - shell: bash + with: + persist-credentials: false - uses: actions/setup-java@v2 with: diff --git a/.github/workflows/maven.yml b/.github/workflows/staging.yml similarity index 52% copy from .github/workflows/maven.yml copy to .github/workflows/staging.yml index 6a62e60..80a662e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/staging.yml @@ -15,23 +15,28 @@ # specific language governing permissions and limitations # under the License. -name: Maven CI +name: Stage main branch on: workflow_dispatch: {} - push: - branches: [ main, jbake ] - pull_request: - branches: [ main, jbake ] + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: 'Checkout main' + uses: actions/checkout@v2 + with: + ref: 'main' + path: 'src' + persist-credentials: false - - run: sed -i.bak 's/site.host=.*/site.host=https:\/\/shiro-jbake.staged.apache.org\//g' jbake.properties && rm jbake.properties.bak + - run: cd src && sed -i.bak 's/site.host=.*/site.host=https:\/\/shiro.staged.apache.org\//g' jbake.properties && rm jbake.properties.bak + shell: bash + + - run: cd src && mv src/site/asssets/robots.staging.txt src/site/asssets/robots.txt shell: bash - uses: actions/setup-java@v2 @@ -39,4 +44,16 @@ jobs: java-version: '11' distribution: 'temurin' - - run: mvn generate-resources --show-version --errors --batch-mode --no-transfer-progress + - run: cd src && mvn generate-resources --show-version --errors --batch-mode --no-transfer-progress + + - name: 'Checkout target' + uses: actions/checkout@v2 + with: + repository: 'apache/shiro-site' + ref: 'asf-staging' + path: 'site-staging' + + - name: 'Copy to staging' + run: rsync -avP src/target/website/. ../site-staging && git commit -a -m "staging $(date -Is)" && git push + shell: bash + diff --git a/src/site/assets/robots.staging.txt b/src/site/assets/robots.staging.txt new file mode 100644 index 0000000..2f73afc --- /dev/null +++ b/src/site/assets/robots.staging.txt @@ -0,0 +1,15 @@ +Sitemap: https://shiro.apache.org/sitemap.xml + +User-agent: linkcheck +Disallow: + +User-agent: Twitterbot +Disallow: + +User-Agent: FacebookBot +Disallow: + +User-agent: * +Disallow: / +Disallow: /* +Disallow: *
