From aaf338378989c0436a315d11d6394a979215bb9a Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Sun, 1 Sep 2024 15:50:05 +0300 Subject: [PATCH] Rewrite workflow --- .github/Dockerfile | 2 +- .github/workflows/container.yml | 53 ++++----------------------------- Dockerfile | 2 +- 3 files changed, 8 insertions(+), 49 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index e2a563b..09c66b7 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -5,6 +5,6 @@ LABEL org.opencontainers.image.description="Yii Dev Panel" LABEL org.opencontainers.image.licenses=BSD-3-Clause RUN rm -rf /usr/share/nginx/html/* -COPY /tmp/dist /usr/share/nginx/html +COPY dist /usr/share/nginx/html ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index e73937e..a820eb9 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -13,49 +13,6 @@ on: types: - created -#jobs: -# build-release: -# if: "!github.event.release.prerelease" -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# platform: -# - linux/amd64 -# - linux/arm64 -# -# # See https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners -# steps: -# - uses: actions/checkout@v4 -# -# - name: Log in to registry -# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin -# -# - name: Get Previous tag -# id: previoustag -# uses: "WyriHaximus/github-action-get-previous-tag@v1" -# with: -# fallback: v0.1 -# -# - name: Set up Docker Buildx -# id: buildx -# uses: docker/setup-buildx-action@v3 -# -# - name: Build and push -# id: docker_build -# uses: docker/build-push-action@v6 -# with: -# push: true -# context: . -# target: target -# file: ./Dockerfile -# cache-from: type=gha -# cache-to: type=gha,mode=max -# platforms: ${{ matrix.platform }} -# build-args: VITE_BUILD_ID="Github Actions" -# tags: -# ${{ env.REGISTRY_IMAGE }}:latest, ${{ env.REGISTRY_IMAGE }}:${{ steps.previoustag.outputs.tag }} - jobs: build-node: runs-on: ubuntu-latest @@ -115,11 +72,14 @@ jobs: with: images: ${{ env.REGISTRY_IMAGE }} - - name: Download builder image + - name: Download JS build uses: actions/download-artifact@v4 with: name: js-build - path: /tmp/dist + path: dist + + - name: List extracted files + run: ls -la dist - name: Get Previous tag id: previoustag @@ -131,11 +91,10 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push - id: docker_build uses: docker/build-push-action@v6 with: - push: true context: . + push: true file: ./.github/Dockerfile cache-from: type=gha cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 41b61f1..3e0250f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,6 @@ LABEL org.opencontainers.image.description="Yii Dev Panel" LABEL org.opencontainers.image.licenses=BSD-3-Clause RUN rm -rf /usr/share/nginx/html/* -COPY --from=builder /app/packages/yii-dev-panel/dist /usr/share/nginx/html +COPY --from=builder /app/packages/yii-dev-panel/dist /usr/share/nginx/html ENTRYPOINT ["nginx", "-g", "daemon off;"]