Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

4.4.025-rc-6

4.4.025-rc-6 #497

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
# This file was contributed by Carlos Parada, Edwin Betancourt, and Yamel Senih from ERP Consultores y Asociados, C.A
name: Publish Project
on:
release:
types:
- created
- edited
jobs:
# Build dist application ADempiere-Vue
build-app:
name: Build dist ADempiere-Vue
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Node configuration
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
- name: Set tag version into config file
run: sed -i "s|develop-1.0.0|${{ github.event.release.tag_name }}|g" config/default.json
- name: Set tag version into config file
run: sed -i "s|releaseNoForDocumentation|${{ github.event.release.tag_name }}|g" config/default.json
- name: Enable https to install packages
run: git config --global url."https://".insteadOf git://
# - name: Install packages lerna
# run: yarn global add lerna
# - name: Update sub module
# run: git submodule update --init --remote
- name: Install packages
run: yarn ci
- name: Compile dist
run: yarn build:prod
- name: Upload dist app
uses: actions/upload-artifact@v3
with:
name: adempiere-vue
path: dist
# Publish dist binaries to application
publish-app-dist:
name: Upload ADempiere-Vue binaries
# TODO: Does not support edit release: {"resource":"Release","code":"already_exists","field":"tag_name"}
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
needs:
- build-app
runs-on: ubuntu-latest
steps:
- name: Download build dist app
uses: actions/download-artifact@v3
with:
name: adempiere-vue
- name: Compress files for application dist
uses: TheDoctor0/[email protected]
with:
filename: 'Adempiere-Vue.zip'
path: './'
- name: Publish application binary in repository
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'Adempiere-Vue.zip'
# Check secrets to push image in docker hub registry
check-docker-secrets:
name: Check if docker hub registry information was set on secrets
needs:
- build-app
runs-on: ubuntu-latest
outputs:
is_have_secrets: ${{ steps.check_secret_job.outputs.is_have_secrets }}
steps:
- id: check_secret_job
run: |
if [[ "${{ secrets.DOCKER_REPO_FRONTEND }}" != "" && \
"${{ secrets.DOCKER_USERNAME }}" != "" && \
"${{ secrets.DOCKER_TOKEN }}" != "" ]]; \
then
echo "Secrets to use a container registry are configured in the repo"
echo "is_have_secrets=true" >> $GITHUB_OUTPUT
else
echo "Secrets to use a container registry were not configured in the repo"
echo "is_have_secrets=false" >> $GITHUB_OUTPUT
fi
# Publish docker alpine image in Docker Hub registry to application
push-alpine-imame-dhr:
name: Push docker alpine image to Docker Hub
needs:
- check-docker-secrets
# Skip step based on secret
if: needs.check-docker-secrets.outputs.is_have_secrets == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Download build dist app
uses: actions/download-artifact@v3
with:
name: adempiere-vue
path: dist
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
# CONFIGURE DOCKER SECRETS INTO REPOSITORY
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker Image Alpine
uses: docker/[email protected]
with:
context: .
file: ./build/production-alpine.Dockerfile
push: true
tags: |
${{ secrets.DOCKER_REPO_FRONTEND }}:alpine
${{ secrets.DOCKER_REPO_FRONTEND }}:alpine-${{ github.event.release.tag_name }}
# Publish docker image in Docker Hub registry to application
push-imame-dhr:
name: Push docker image to Docker Hub
needs:
- check-docker-secrets
# Skip step based on secret
if: needs.check-docker-secrets.outputs.is_have_secrets == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Download build dist app
uses: actions/download-artifact@v3
with:
name: adempiere-vue
path: dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
# CONFIGURE DOCKER SECRETS INTO REPOSITORY
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
file: ./build/production.Dockerfile
platforms: linux/amd64,linux/amd64/v2,linux/arm64/v8
push: true
tags: |
${{ secrets.DOCKER_REPO_FRONTEND }}:latest
${{ secrets.DOCKER_REPO_FRONTEND }}:${{ github.event.release.tag_name }}
# Build dist documentation ADempiere-Vue
build-docs:
name: Build dist ADempiere-Vue docs
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Node configuration
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
- name: Enable https to install packages
run: git config --global url."https://".insteadOf git://
- name: Generate dist docs
run: |
cd docs
yarn ci
yarn build
- name: Upload dist docs
uses: actions/upload-artifact@v3
with:
name: adempiere-vue-docs
path: docs/.vuepress/dist
# Publish dist binaries to documentation
publish-docs-dist:
name: Upload ADempiere-Vue docs binaries
needs:
- build-docs
runs-on: ubuntu-latest
steps:
- name: Download build dist docs
uses: actions/download-artifact@v3
with:
name: adempiere-vue-docs
- name: Compress files for documentation dist
uses: TheDoctor0/[email protected]
with:
filename: 'Adempiere-Vue-Documentation.zip'
path: './'
- name: Publish documentation binary in repository
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'Adempiere-Vue-Documentation.zip'