diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b2397138..33781cfc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ name: Publish Project on: release: - types: + types: - created - edited @@ -71,9 +71,9 @@ jobs: args: 'Adempiere-Vue.zip' - # Publish docker image to application - push-imame-gpr: - name: Push Docker image to GitHub Packages + # Publish docker image in Github Container Registry to application + push-imame-ghcr: + name: Push Docker image to GitHub Container needs: - build-app runs-on: ubuntu-latest @@ -87,20 +87,72 @@ jobs: name: adempiere-vue path: dist - - name: Log in to GitHub Docker Registry + - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: - registry: docker.pkg.github.com + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: set lower case owner name + - name: Set Lower Case to owner and repository run: | echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV} - echo "REPO_LC=${REPO,,}" >> ${GITHUB_ENV} - echo "IMAGE_NAME=adempiere-vue" >> ${GITHUB_ENV} + echo "REPO_LC=${NAME,,}" >> ${GITHUB_ENV} + echo "OWNER_REPO_LC=${REPO,,}" >> ${GITHUB_ENV} env: OWNER: '${{ github.repository_owner }}' + NAME: '${{ github.event.repository.name }}' + REPO: '${{ github.repository }}' + + - run: echo ${{ env }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + file: ./build/Dockerfile.prod + push: true + # load: true + tags: | + ghcr.io/${{ env.OWNER_LC }}/${{ env.REPO_LC }}:latest + ghcr.io/${{ env.OWNER_LC }}/${{ env.REPO_LC }}:${{ github.sha }} + ghcr.io/${{ env.OWNER_LC }}/${{ env.REPO_LC }}:${{ github.event.release.tag_name }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} + + + # Publish docker image in Docker Hub registry to application + push-imame-dhr: + name: Push Docker image to Docker Hub + needs: + - build-app + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Download build dist app + uses: actions/download-artifact@v2 + with: + name: adempiere-vue + path: dist + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + # CONFIGURE DOCKER SECRETS INTO REPOSITORY + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set Lower Case to owner and repository + run: | + echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV} + echo "REPO_LC=${NAME,,}" >> ${GITHUB_ENV} + echo "OWNER_REPO_LC=${REPO,,}" >> ${GITHUB_ENV} + env: + OWNER: '${{ github.repository_owner }}' + NAME: '${{ github.event.repository.name }}' REPO: '${{ github.repository }}' - name: Build and push Docker image @@ -110,8 +162,9 @@ jobs: file: ./build/Dockerfile.prod push: true tags: | - docker.pkg.github.com/${{ env.REPO_LC }}/${{ env.IMAGE_NAME }}:${{ github.sha }} - docker.pkg.github.com/${{ env.REPO_LC }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} + ${{ env.OWNER_LC }}/${{ env.REPO_LC }}:latest + ${{ env.OWNER_LC }}/${{ env.REPO_LC }}:${{ github.sha }} + ${{ env.OWNER_LC }}/${{ env.REPO_LC }}:${{ github.event.release.tag_name }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/README.es.md b/README.es.md index 3345bcef..b939cab5 100644 --- a/README.es.md +++ b/README.es.md @@ -4,25 +4,29 @@
+ Español | [Inglés](./README.md) ## Introducción @@ -36,7 +40,7 @@ Este es una gran UI para [ADempiere ERP, CRM & SCM](https://github.com/adempiere [adempiere-vue](https://github.com/adempiere/adempiere-vue) usa como RPC (Llamado a Procedimientos Remotos)[gRPC](https://grpc.io/) como [server](https://github.com/adempiere/adempiere-gRPC-Server). - [Vista Prévia de la Aplicación](https://demo-ui.erpya.com/) - + - **User**: demo - **Password**: demo @@ -233,7 +237,7 @@ Los cambios detallados por cada liberación se encuentran en [notas de liberaci ## Demostración en línea [Vista Prévia de la Aplicación](https://demo-ui.erpya.com/) - + - **User**: demo - **Password**: demo diff --git a/README.md b/README.md index b4325cef..50a3ae83 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,25 @@ @@ -37,7 +40,7 @@ It is a great UI for [ADempiere ERP, CRM & SCM](https://github.com/adempiere/ade [adempiere-vue](https://github.com/adempiere/adempiere-vue) use the modern open source high performance RPC framework that can run in any environment [gRPC](https://grpc.io/) as [server](https://github.com/adempiere/adempiere-gRPC-Server). - [Preview](https://demo-ui.erpya.com/) - + - **User**: demo - **Password**: demo diff --git a/build/Dockerfile.dist b/build/Dockerfile.dist new file mode 100644 index 00000000..b8d02b1f --- /dev/null +++ b/build/Dockerfile.dist @@ -0,0 +1,37 @@ +FROM nginx:1.21.1-alpine + +LABEL maintainer="EdwinBetanc0urt@outlook.com" \ + description="ADempiere-Vue" + +# Add operative system dependencies +RUN rm -rf /var/cache/apk/* && \ + apk update && \ + apk add \ + --virtual .build-deps \ + ca-certificates \ + curl \ + unzip + +ARG RELEASE_VERSION="rt-4.8" + +ENV URL_REPO="https://github.com/adempiere/adempiere-vue" \ + BINARY_NAME="Adempiere-Vue.zip" \ + API_URL="https://api.erpya.com" + +COPY start.sh . + +# Create app directory +RUN cd /usr/share/nginx/html && \ + # Download release file + curl --output $BINARY_NAME \ + -L "$URL_REPO/releases/download/$RELEASE_VERSION/$BINARY_NAME" && \ + # uncompress and delete files + unzip -o $BINARY_NAME && \ + # delete unised files + apk del .build-deps && \ + rm $BINARY_NAME && \ + rm -rf /tmp/* && \ + # Rename project folder + mv dist/* /usr/share/nginx/html/ + +CMD 'sh' 'start.sh' diff --git a/build/Dockerfile.prod b/build/Dockerfile.prod index f0912907..2a5efcd9 100644 --- a/build/Dockerfile.prod +++ b/build/Dockerfile.prod @@ -1,4 +1,4 @@ -FROM nginx:1.19.9-alpine +FROM nginx:1.21.1-alpine LABEL maintainer="EdwinBetanc0urt@outlook.com" \