diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..d994cbd7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,72 @@ + + +## What type of PR is this? + +_(REQUIRED)_ + + + +- bug +- cleanup +- documentation +- feature + +## What this PR does / why we need it: + +_(REQUIRED)_ + + + +## Which issue(s) this PR fixes: + +_(REQUIRED)_ + + + +## Special notes for your reviewer: + +_(fill-in or delete this section)_ + + + +## Testing + +_(fill-in or delete this section)_ + + + +## Release Notes + +_(REQUIRED)_ + + +```release-note +``` diff --git a/.github/workflows/backend-docker-nightly.yml b/.github/workflows/backend-docker-nightly.yml deleted file mode 100644 index 78738c14..00000000 --- a/.github/workflows/backend-docker-nightly.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Backend - Nightly Build - -on: - push: - branches: - - mealie-next - -concurrency: - group: backend-nightly-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - # - # Checkout - # - - name: checkout code - uses: actions/checkout@v2 - # - # Setup QEMU - # - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - # - # Setup Buildx - # - - name: install buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - # - # Login to Docker Hub - # - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # - # Build - # - - name: build the image - run: | - docker build --push --no-cache \ - --tag hkotel/mealie:api-nightly \ - --build-arg COMMIT=$(git rev-parse HEAD) \ - --platform linux/amd64,linux/arm64 . - # - # Build Discord Notification - # - - name: Discord notification - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }} - uses: Ilshidur/action-discord@0.3.2 - with: - args: "🚀 A New build of mealie:api-nightly is available" diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml deleted file mode 100644 index a5b473c9..00000000 --- a/.github/workflows/beta-release.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Docker Build Production - -on: - release: - types: [published] - -jobs: - build: - runs-on: ubuntu-latest - steps: - # - # Get Release Version - # - - uses: oprypin/find-latest-tag@v1 - with: - repository: hay-kot/mealie # The repository to scan. - releases-only: true # We know that all relevant tags have a GitHub release for them. - id: mealie_version # The step ID to refer to later. - # - # Checkout - # - - name: checkout code - uses: actions/checkout@v2 - # - # Setup QEMU - # - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - # - # Setup Buildx - # - - name: install buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - # - # Login to Docker Hub - # - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # - # Build Backend - # - - name: build the image - run: | - docker build --push --no-cache \ - --tag hkotel/mealie:api-${{ steps.mealie_version.outputs.tag }} \ - --build-arg COMMIT=$(git rev-parse HEAD) \ - --platform linux/amd64,linux/arm64 . - # - # Build Frontend - # - - name: build the image - working-directory: "frontend" - run: | - docker build --push --no-cache \ - --tag hkotel/mealie:frontend-${{ steps.mealie_version.outputs.tag }} \ - --platform linux/amd64,linux/arm64 . - # - # Release Discord Notification - # - - name: Discord notification - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} - uses: Ilshidur/action-discord@0.3.2 - with: - args: '🚀 Version {{ EVENT_PAYLOAD.release.tag_name }} of Mealie has been released. See the release notes https://github.com/hay-kot/mealie/releases/tag/{{ EVENT_PAYLOAD.release.tag_name }}' diff --git a/.github/workflows/frontend-docker-nightly.yml b/.github/workflows/frontend-docker-nightly.yml deleted file mode 100644 index b73eabd3..00000000 --- a/.github/workflows/frontend-docker-nightly.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Frontend - Nightly Build - -on: - push: - branches: - - mealie-next - -concurrency: - group: frontend-nightly-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - # - # Checkout - # - - name: checkout code - uses: actions/checkout@v2 - # - # Setup QEMU - # - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - # - # Setup Buildx - # - - name: install buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - # - # Login to Docker Hub - # - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - # - # Build - # - - name: build the image - working-directory: "frontend" - run: | - docker build --push --no-cache \ - --tag hkotel/mealie:frontend-nightly \ - --platform linux/amd64,linux/arm64 . - # - # Build Discord Notification - # - - name: Discord notification - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }} - uses: Ilshidur/action-discord@0.3.2 - with: - args: "🚀 A New build of mealie:frontend-nightly is available" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..4b208f54 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,37 @@ +name: Docker Nightly Production + +on: + push: + branches: + - mealie-next + +jobs: + backend-tests: + name: "Backend Server Tests" + uses: hay-kot/mealie/.github/workflows/partial-backend.yml@mealie-next + + frontend-tests: + name: "Frontend and End-to-End Tests" + uses: hay-kot/mealie/.github/workflows/partial-frontend.yml@mealie-next + + build-release: + name: Build Tagged Release + uses: hay-kot/mealie/.github/workflows/partial-builder.yml@mealie-next + needs: + - frontend-tests + - backend-tests + with: + tag: nightly + + notify-discord: + name: Notify Discord + needs: + - build-release + runs-on: ubuntu-latest + steps: + - name: Discord notification + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }} + uses: Ilshidur/action-discord@0.3.2 + with: + args: "🚀 A New build of mealie:api-nightly and mealie:frontend-nightly is available" diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/partial-backend.yml similarity index 93% rename from .github/workflows/backend-tests.yml rename to .github/workflows/partial-backend.yml index d8e3dc83..322af86d 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/partial-backend.yml @@ -1,12 +1,8 @@ -name: Backend Tests +name: Backend Test/Lint + on: - push: - branches: - - mealie-next - pull_request: - branches: - - mealie-next - types: [synchronize, opened, reopened, ready_for_review] + workflow_call: + jobs: tests: diff --git a/.github/workflows/partial-builder.yml b/.github/workflows/partial-builder.yml new file mode 100644 index 00000000..971a7620 --- /dev/null +++ b/.github/workflows/partial-builder.yml @@ -0,0 +1,48 @@ +name: Build Containers + +on: + workflow_call: + inputs: + tag: + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build Backend Image + run: | + docker build --push --no-cache \ + --tag hkotel/mealie:api-${{ inputs.tag }} \ + --build-arg COMMIT=$(git rev-parse HEAD) \ + --platform linux/amd64,linux/arm64 . + + - name: Build Frontend Image + working-directory: "frontend" + run: | + docker build --push --no-cache \ + --tag hkotel/mealie:frontend-${{ inputs.tag }} \ + --platform linux/amd64,linux/arm64 . diff --git a/.github/workflows/frontend-lint.yml b/.github/workflows/partial-frontend.yml similarity index 95% rename from .github/workflows/frontend-lint.yml rename to .github/workflows/partial-frontend.yml index 7cfe4ae8..e4bc66b8 100644 --- a/.github/workflows/frontend-lint.yml +++ b/.github/workflows/partial-frontend.yml @@ -1,12 +1,7 @@ -name: Frontend Lint +name: Frontend Build/Lin on: - push: - branches: - - mealie-next - pull_request: - branches: - - mealie-next + workflow_call: jobs: lint: diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml new file mode 100644 index 00000000..1e5b9c89 --- /dev/null +++ b/.github/workflows/pull-requests.yml @@ -0,0 +1,15 @@ +name: PR CI + +on: + pull_request: + branches: + - mealie-next + +jobs: + backend-tests: + name: "Backend Server Tests" + uses: hay-kot/mealie/.github/workflows/partial-backend.yml@mealie-next + + frontend-tests: + name: "Frontend and End-to-End Tests" + uses: hay-kot/mealie/.github/workflows/partial-frontend.yml@mealie-next diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ef1561e7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Docker Build Production + +on: + release: + types: [published] + +jobs: + backend-tests: + name: "Backend Server Tests" + uses: hay-kot/mealie/.github/workflows/partial-backend.yml@mealie-next + + frontend-tests: + name: "Frontend and End-to-End Tests" + uses: hay-kot/mealie/.github/workflows/partial-frontend.yml@mealie-next + + get-release: + name: "Get Releave Tag" + runs-on: ubuntu-latest + needs: + - backend-tests + - frontend-tests + outputs: + tag: ${{ steps.get-tag.outputs.tag }} + steps: + - uses: oprypin/find-latest-tag@v1 + with: + repository: hay-kot/mealie # The repository to scan. + releases-only: true # We know that all relevant tags have a GitHub release for them. + build-release: + name: Build Tagged Release + uses: hay-kot/mealie/.github/workflows/partial-builder.yml@mealie-next + needs: + - get-release + with: + tag: ${{ jobs.get-release.outputs.tag }} + + notify-discord: + name: Notify Discord + needs: + - build-release + runs-on: ubuntu-latest + steps: + - name: Discord notification + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} + uses: Ilshidur/action-discord@0.3.2 + with: + args: "🚀 Version {{ EVENT_PAYLOAD.release.tag_name }} of Mealie has been released. See the release notes https://github.com/hay-kot/mealie/releases/tag/{{ EVENT_PAYLOAD.release.tag_name }}"