diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml new file mode 100644 index 000000000..1b7822246 --- /dev/null +++ b/.github/workflows/publish-site.yml @@ -0,0 +1,31 @@ +name: Publish Site +on: + push: + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # setup build environment + - uses: coursier/cache-action@v5 + - uses: olafurpg/setup-scala@v12 + + # this setup is all for the github pages deployment to work + - name: install sphinx + run: | + pip3 install --user sphinx sphinx_rtd_theme + which sphinx-build + + - name: setup git + run: | + git config --global user.name github-actions + git config --global user.email github-actions@github.com + + - name: Publish Site + run: sbt ghpagesPushSite + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad24bd6ca..3ea0099ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,24 +20,6 @@ jobs: SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - # this setup is all for the github pages deployment to work - - name: install sphinx - run: | - pip3 install --user sphinx sphinx_rtd_theme - which sphinx-build - - - name: setup git - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - - name: Install SSH key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.SSH_KEY }} - known_hosts: ${{ secrets.KNOWN_HOSTS }} - - run: sbt ghpagesPushSite - # generate a github release - name: Generate release changelog id: changelog diff --git a/build.sbt b/build.sbt index 4e82b1d5a..dd75d7ed1 100644 --- a/build.sbt +++ b/build.sbt @@ -53,7 +53,12 @@ libraryDependencies ++= { // configure github page enablePlugins(SphinxPlugin, SiteScaladocPlugin, GhpagesPlugin, SbtPlugin) -git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git" +git.remoteRepo := { + sys.env.get("GITHUB_TOKEN") match { + case Some(token) => s"https://x-access-token:$token@github.com/sbt/sbt-native-packager" + case None => "git@github.com:sbt/sbt-native-packager.git" + } +} // scripted test settings scriptedLaunchOpts += "-Dproject.version=" + version.value