Build documentation and create docker #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rollup | |
on: | |
push: | |
branches: [ "master" ] | |
env: | |
# Use docker.io for Docker Hub if empty | |
# github.repository as <account>/<repo> | |
REGISTRY: ${{vars.LOGIN}} | |
IMAGE_NAME: ${{vars.IMAGE}} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: cd ./docs/sliver-docs && npm install | |
- run: cd ./docs/sliver-docs && npm run offline | |
- run: cd ./docs/sliver-docs && ls -alhrt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: app-build | |
path: ./docs/sliver-docs/www.zip | |
- name: Install cosign | |
if: github.event_name != 'pull_request' | |
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 | |
with: | |
cosign-release: 'v2.2.4' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Log into registry ${{env.REGISTRY}} | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ${{vars.REGISTRY}} | |
username: ${{vars.LOGIN}} | |
password: ${{secrets.DOCKER_HUB}} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 | |
with: | |
images: ${{env.REGISTRY}}/${{vars.IMAGE}}-doc | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | |
with: | |
context: ./docs/sliver-docs | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: ./docs/Dockerfile |