From 1414c49d4a0a2b52ec746985a9abe52cc15ee409 Mon Sep 17 00:00:00 2001 From: Griefed Date: Mon, 22 Mar 2021 08:46:27 +0100 Subject: [PATCH] ci: Implement changes learned from ServerPackCreator CI/CD-Pipeline --- .github/workflows/ci-publish-latest.yml | 55 ----------------- .github/workflows/ci-publish-tag.yml | 81 +++++++++++++------------ .gitignore | 3 + 3 files changed, 45 insertions(+), 94 deletions(-) delete mode 100644 .github/workflows/ci-publish-latest.yml diff --git a/.github/workflows/ci-publish-latest.yml b/.github/workflows/ci-publish-latest.yml deleted file mode 100644 index 2ca704e..0000000 --- a/.github/workflows/ci-publish-latest.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: ci-publish-latest - -on: - push: - branches: - - lsiobase/alpine - -jobs: - multi-registries: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - 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: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - - name: Build and push port - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile.port - platforms: linux/amd64,linux/arm/v7,linux/arm64 - push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:port - ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:port - - - name: Build and push proxy - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile.proxy - platforms: linux/amd64,linux/arm/v7,linux/arm64 - push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:proxy - ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:proxy \ No newline at end of file diff --git a/.github/workflows/ci-publish-tag.yml b/.github/workflows/ci-publish-tag.yml index 6f6d6b6..1fa9a6c 100644 --- a/.github/workflows/ci-publish-tag.yml +++ b/.github/workflows/ci-publish-tag.yml @@ -1,63 +1,66 @@ name: ci-publish-tag on: - push: - tags: - - '*.*' + workflow_dispatch: jobs: multi-registries: runs-on: ubuntu-latest steps: - - - name: Checkout + # SETUP ENVIRONMENT + - name: Checkout uses: actions/checkout@v2 - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - - name: Get the version - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) - - - name: Login to DockerHub - uses: docker/login-action@v1 + # GENERATE CHANGELOG, TAG, RELEASE + - id: conventional_changelog + uses: ardalanamini/auto-changelog@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - id: compute_tag + uses: craig-day/compute-tag@v11 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version_scheme: semantic + version_type: patch + # MAJOR.MINOR.PATCH + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.compute_tag.outputs.next_tag }} + release_name: "D-Zone" + body: | + Automatic release of version: **${{ steps.compute_tag.outputs.next_tag }}** + **Changes in this release:** + ${{ steps.conventional_changelog.outputs.changelog }} + draft: false + prerelease: false + # DOCKER RELATED + - name: Login to DockerHub + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - - name: Build and push port - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile.port - platforms: linux/amd64,linux/arm/v7,linux/arm64 - push: true - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:port - ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:port - ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:port-${{steps.vars.outputs.tag}} - ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:port-${{steps.vars.outputs.tag}} - - - name: Build and push proxy + - name: Build and push uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.proxy + file: ./Dockerfile platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:proxy - ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:proxy - ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:proxy-${{steps.vars.outputs.tag}} - ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:proxy-${{steps.vars.outputs.tag}} \ No newline at end of file + ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest + ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{ steps.compute_tag.outputs.next_tag }} + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{ steps.compute_tag.outputs.next_tag }} diff --git a/.gitignore b/.gitignore index a0d3145..5b41ca1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# IntelliJ Idea +.idea \ No newline at end of file