From 1580aa2b6ff8569ae2963eecac61482c05d9c69f Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Fri, 12 Nov 2021 15:36:36 +0000 Subject: [PATCH] chore: merge main actions back to single workflow Signed-off-by: Steve Hipwell --- .github/workflows/docker.yml | 78 ----------------------------- .github/workflows/main.yml | 95 ++++++++++++++++++++++++++++++++++++ .github/workflows/pages.yml | 34 ------------- 3 files changed, 95 insertions(+), 112 deletions(-) delete mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index e4835e2..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Docker - -on: - workflow_run: - workflows: - - Main - types: - - completed - -jobs: - build: - runs-on: ubuntu-latest - if: github.event.workflow_run.conclusion == 'success' - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Docker tomcat meta - id: docker_meta_tomcat - uses: crazy-max/ghaction-docker-meta@v3 - with: - flavor: | - latest=false - prefix= - suffix= - images: plantuml/plantuml-server - tags: | - type=semver,pattern=tomcat-{{raw}} - type=raw,value=tomcat - - - name: Docker jetty meta - id: docker_meta_jetty - uses: crazy-max/ghaction-docker-meta@v3 - with: - flavor: | - latest=true - prefix= - suffix= - images: plantuml/plantuml-server - tags: | - type=semver,pattern={{raw}} - type=semver,pattern=jetty-{{raw}} - type=raw,value=jetty - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build & push tomcat - id: docker_build_tomcat - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile.tomcat - platforms: linux/amd64 - push: true - tags: ${{ steps.docker_meta_tomcat.outputs.tags }} - labels: ${{ steps.docker_meta_tomcat.outputs.labels }} - - - name: Build & push jetty - id: docker_build_jetty - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile.jetty - platforms: linux/amd64 - push: true - tags: ${{ steps.docker_meta_jetty.outputs.tags }} - labels: ${{ steps.docker_meta_jetty.outputs.labels }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a2b91fa..57ee396 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,3 +110,98 @@ jobs: tag: ${{ github.ref }} overwrite: true file_glob: true + + publish-docker: + runs-on: ubuntu-latest + needs: + - publish-releases + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Docker tomcat meta + id: docker_meta_tomcat + uses: crazy-max/ghaction-docker-meta@v3 + with: + flavor: | + latest=false + prefix= + suffix= + images: plantuml/plantuml-server + tags: | + type=semver,pattern=tomcat-{{raw}} + type=raw,value=tomcat + + - name: Docker jetty meta + id: docker_meta_jetty + uses: crazy-max/ghaction-docker-meta@v3 + with: + flavor: | + latest=true + prefix= + suffix= + images: plantuml/plantuml-server + tags: | + type=semver,pattern={{raw}} + type=semver,pattern=jetty-{{raw}} + type=raw,value=jetty + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build & push tomcat + id: docker_build_tomcat + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.tomcat + platforms: linux/amd64 + push: true + tags: ${{ steps.docker_meta_tomcat.outputs.tags }} + labels: ${{ steps.docker_meta_tomcat.outputs.labels }} + + - name: Build & push jetty + id: docker_build_jetty + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.jetty + platforms: linux/amd64 + push: true + tags: ${{ steps.docker_meta_jetty.outputs.tags }} + labels: ${{ steps.docker_meta_jetty.outputs.labels }} + + publish-pages: + runs-on: ubuntu-latest + needs: + - publish-releases + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v2 + with: + distribution: "zulu" + java-version: 11 + check-latest: true + cache: "maven" + + - name: Create GitHub Pages + run: mvn site + + - name: Deploy GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./target/site diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index 5967ffe..0000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Pages - -on: - workflow_dispatch: - workflow_run: - workflows: - - Main - types: - - completed - -jobs: - pages: - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - uses: actions/setup-java@v2 - with: - distribution: "zulu" - java-version: 11 - check-latest: true - cache: "maven" - - - name: Create GitHub Pages - run: mvn site - - - name: Deploy GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/site