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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
name: Website
on:
push:
tags:
- 'website*'
workflow_dispatch:
permissions:
contents: write
jobs:
website:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
ref: ${{ github.ref }}
fetch-tags: true
- name: Setup git
run: |
git config --global user.name "Stephen Colebourne (CI)"
git config --global user.email "scolebourne@joda.org"
- name: Set up JDK
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 #v4.7.0
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'
- name: Maven version
run: |
mkdir -p ./.mvn
echo "-e" >> ./.mvn/maven.config
echo "-B" >> ./.mvn/maven.config
echo "-ntp" >> ./.mvn/maven.config
echo "-DtrimStackTrace=false" >> ./.mvn/maven.config
echo "--settings" >> ./.mvn/maven.config
echo "$( pwd )/.github/maven-settings.xml" >> ./.mvn/maven.config
mvn --version
mkdir -p target
#------------------------------------------------------------------------
- name: Maven site
run: |
mvn install site
- name: Checkout website
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
repository: JodaOrg/jodaorg.github.io
path: target/jodaorg.github.io
ref: "main"
- name: Update website
run: |
cd target/jodaorg.github.io
git status
rm -rf joda-time/
cp -R ../site joda-time/
git add -A
git status
git commit --message "Update joda-time from CI: $GITHUB_RUN_ID"
git push origin main
# delete the initiating tag, but not if the build is manually initialized by workflow_dispatch
- name: Delete website tag
if: "always() && github.ref != 'refs/heads/main'"
run: |
git tag --delete "${GITHUB_REF_NAME}" || true
git push --delete origin "${GITHUB_REF_NAME}" || true
|