From 5822e88d42df26626b3b09fdc307b9e7ab2cfeb5 Mon Sep 17 00:00:00 2001 From: joeyak Date: Mon, 25 Mar 2024 10:10:37 -0400 Subject: [PATCH] Switch to docker image needing the pre-build --- .github/workflows/docker.yaml | 47 ----------------------------------- .github/workflows/main.yaml | 43 +++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/docker.yaml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 05b32be..0000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Docker - -on: - push: - branches: - - master - tags: - - v*.*.* - - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 558a551..f8ea0b5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,12 +2,19 @@ name: Build on: push: - branches: [master] + branches: + - master + tags: + - v*.*.* pull_request: branches: [] workflow_dispatch: +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + jobs: pre-build: runs-on: ubuntu-latest @@ -57,3 +64,37 @@ jobs: name: MovieNight-${{ matrix.os }}-${{ matrix.arch }} if-no-files-found: error path: MovieNight* + + docker: + runs-on: ubuntu-latest + + needs: pre-build + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}