Skip to content

Commit

Permalink
Add build and deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
miesgre committed Jan 17, 2024
1 parent 321cfd3 commit 2356c49
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build & Deploy

on:
push:
branches:
- master

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: build-and-deploy
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 11
distribution: 'corretto'

- name: Build
run: ./gradlew clean build

- name: Prepare artifact
run: |
mkdir -p mirror-root
sudo mkdir /etc/cas
sudo chown $USER:$USER /etc/cas
./gradlew createKeystore
java -jar build/libs/cas.war &
PID=$!
sleep 60
wget --no-check-certificate --mirror --convert-links --adjust-extension --page-requisites --no-parent -P mirror-root https://localhost:8443/cas/login
kill $PID
- name: Upload as artifact
uses: actions/upload-pages-artifact@v1
with:
path: mirror-root/localhost:8443/cas

deploy:
needs: build
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

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

0 comments on commit 2356c49

Please sign in to comment.