Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #182
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: Workflow | |
on: | |
push: | |
branches: [ "mainline" ] | |
pull_request: | |
branches: "*" | |
env: | |
DOC_DIR: build/dokka/html/ | |
jobs: | |
build: | |
name: Build Kotlin code and Docker Image | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Build stuff | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "11" | |
distribution: "adopt" | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b | |
- name: Gradle build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: installDist | |
- name: Ktlint | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: ktlintCheck | |
- name: Unit tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: test | |
- name: Integration tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: integTest | |
# Docker stuff | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker container | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
load: true | |
push: false | |
tags: whylabs/whylogs:${{ github.sha }} | |
outputs: type=docker,dest=/tmp/whylogs-container.tar | |
- name: Upload container artifact | |
if: ${{ !github.event.act }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: container | |
path: /tmp/whylogs-container.tar | |
preview-docs: | |
name: Generate a preview of the docs | |
timeout-minutes: 5 | |
if: ${{ !github.event.act && github.event_name != 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build docs | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: dokkaHtml | |
- name: "Deploy to Netlify" | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: ${{ env.DOC_DIR }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 1 | |
publish-docs: | |
name: Push generated docs to the docs repo | |
timeout-minutes: 5 | |
if: ${{ !github.event.act && github.event_name == 'push' }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build docs | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: dokkaHtml | |
- name: Get the swagger definition | |
run: ./scripts/get-swagger-def.sh | |
- name: Generate redoc page for swagger docs | |
uses: seeebiii/redoc-cli-github-action@v10 | |
with: | |
args: 'bundle -o ${{ env.DOC_DIR }}/whylogs-container.html ${{ env.DOC_DIR }}/swagger.json' | |
- name: Push docs to the doc repo | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
SSH_DEPLOY_KEY: ${{ secrets.WHYLOGS_CONTAINER_DOCS_SSH}} | |
with: | |
source-directory: ${{ env.DOC_DIR }} | |
destination-github-username: 'whylabs' | |
destination-repository-name: 'whylogs-container-docs' | |
user-email: [email protected] | |
target-branch: master | |
publish_docker_image: | |
name: Publish the Docker image to Docker Hub | |
timeout-minutes: 5 | |
if: ${{ !github.event.act && github.event_name == 'push' }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Download container artifact | |
uses: actions/[email protected] | |
with: | |
name: container | |
path: /tmp | |
- name: Load Docker image | |
run: | | |
docker load --input /tmp/whylogs-container.tar | |
docker tag whylabs/whylogs:${{ github.sha }} whylabs/whylogs:latest | |
docker image ls -a | |
- name: Push Docker container | |
run: | | |
docker push whylabs/whylogs:${{ github.sha }} | |
docker push whylabs/whylogs:latest |