Skip to content

Commit

Permalink
Rewrite workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Sep 1, 2024
1 parent eb1af46 commit aaf3383
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;"]
53 changes: 6 additions & 47 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;"]

0 comments on commit aaf3383

Please sign in to comment.