diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index e6641a9..c2d0674 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -1,14 +1,14 @@ pool: vmImage: 'ubuntu-20.04' steps: -# TODO test repository_dispatch +# TODO test repository_dispatch refs/pull/56/merge # FIXME repository # FIXME ref - bash: | curl --data '{"event_type": "jacoco build"}' \ -H "Authorization: token ${GH_TOKEN}" \ https://api.github.com/repos/Godin/www.eclemma.org/dispatches - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/pull/56/merge')) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) displayName: Deploy env: GH_TOKEN: $(GH_TOKEN) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46b0d9f..b63cfc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,57 +2,13 @@ name: CI on: - push - pull_request - - repository_dispatch jobs: build: runs-on: ubuntu-20.04 # TODO repository and ref - environment: ${{ (github.repository == 'Godin/www.eclemma.org' && github.ref == 'refs/heads/github-actions') && 'sites' || null }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 - name: 'Build' run: ./render.sh - - name: 'Deploy' - if: ${{ (github.repository == 'Godin/www.eclemma.org' && github.ref == 'refs/heads/github-actions') }} - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} - GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} - run: | - WORKING_DIR="`pwd`/work" - RESULT_DIR=$WORKING_DIR/result - TEMP=/tmp/jacoco-snapshot - mkdir $TEMP - wget -O $TEMP/download.zip "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.jacoco&a=jacoco&e=zip&v=LATEST" - unzip $TEMP/download.zip -d $TEMP - - TARGET=$RESULT_DIR/jacoco/trunk - mkdir $TARGET - cp $TEMP/index.html $TARGET - cp -r $TEMP/doc $TARGET/doc - cp -r $TEMP/test $TARGET/test - cp -r $TEMP/coverage $TARGET/coverage - - cd work/result - - # https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/ - touch .nojekyll - - git init - git config user.name ${GIT_COMMITTER_NAME} - git config user.email ${GIT_COMMITTER_EMAIL} - git add . - git commit -q -m "Automatic deployment" - - git push --force "https://${GH_TOKEN}@github.com/jacoco/jacoco.github.io" master > /dev/null 2>&1 - - #echo "www.jacoco.org" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD - #git push --force "https://${GH_TOKEN}@github.com/jacoco/jacoco.org" master:gh-pages > /dev/null 2>&1 - - #echo "www.eclemma.org" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD - #git push --force "https://${GH_TOKEN}@github.com/jacoco/eclemma.org" master:gh-pages > /dev/null 2>&1 - - #echo "www.eclemma.com" > CNAME && git add CNAME && git commit -q --amend --reuse-message=HEAD - #git push --force "https://${GH_TOKEN}@github.com/jacoco/eclemma.com" master:gh-pages > /dev/null 2>&1