Skip to content

Commit

Permalink
Consolidating github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Apr 22, 2024
1 parent 2d7ef0a commit f793562
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 132 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/check.yml

This file was deleted.

115 changes: 115 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
pull_request:
branches: ["main"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Prepare the Static Site
run: ./scripts/github-pages.sh

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload the generated pages
path: './build/static'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

test-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 25

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

- name: Test on Ubuntu
run: ./gradlew assemble check --no-build-cache --no-daemon --stacktrace

all-checks:
if: always()
runs-on: ubuntu-latest
needs:
- test-ubuntu

steps:
- name: require that all other jobs have passed
uses: re-actors/alls-green@release/v1
with:
allowed-skips: publish
jobs: ${{ toJSON(needs) }}

publish-snapshot:
needs: [ all-checks ]
runs-on: ubuntu-latest
if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
timeout-minutes: 25

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

- name: Publish Snapshot
run: ./gradlew :invert-models:publish :invert-plugin:publish :invert-report-common:publish --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

56 changes: 0 additions & 56 deletions .github/workflows/github-pages.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/publish.yml

This file was deleted.

0 comments on commit f793562

Please sign in to comment.