PSF-LoginServer/.github/workflows/publish.yaml
2021-05-26 15:01:04 +00:00

48 lines
1.4 KiB
YAML

name: Publish
on: [push]
jobs:
docs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.ivy2/cache
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: Checkout
uses: actions/checkout@v2
- name: Setup Scala
uses: olafurpg/setup-scala@v10
- name: Build docs
run: sbt docs/unidoc
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/target/scala-2.13/unidoc
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v2.x
- name: Set variables
run: |
echo "REPOSITORY=$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v2.5.0
with:
username: ${{ github.actor }}
password: ${{ github.token }}
registry: docker.pkg.github.com
repository: ${{ env.REPOSITORY }}/server
tag_with_sha: true
tag_with_ref: true