diff --git a/.forgejo/actions/build-node-app/action.yaml b/.forgejo/actions/build-node-app/action.yaml deleted file mode 100644 index ea0d16e..0000000 --- a/.forgejo/actions/build-node-app/action.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Verify package.json version -description: This action build a nodejs app, and run the tests - -inputs: - test_action: - description: Name of the test script - default: test - required: false - - build_action: - description: Name of the build script - default: build - required: false - - build_path: - description: Path of the build output - default: dist - required: false - - artifact_name: - description: Name for the generated artifact - default: dist - required: false - -runs: - using: composite - steps: - - name: Install dependencies - shell: sh - run: apk add nodejs - - - name: Git Clone - uses: actions/checkout@v4 - - - name: Restore Node Modules Cache - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-nodejs-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-nodejs- - - - name: Build and Test - shell: sh - run: | - npm install - npm run ${{ inputs.test_action }} - npm run ${{ inputs.build_action }} - - - uses: actions/upload-artifact@v3 - name: Upload Artifact - with: - name: ${{ inputs.artifact_name }} - path: ${{ inputs.build_path }} diff --git a/.forgejo/actions/check-package-version/action.yaml b/.forgejo/actions/check-package-version/action.yaml deleted file mode 100644 index 8be5a12..0000000 --- a/.forgejo/actions/check-package-version/action.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: Verify package.json version -description: This action will provide $PACKAGE_VERSION env variable, and - -inputs: - package_json_path: - description: Path to package.json file - default: package.json - required: false -outputs: - version_changed: - description: "Whether the version changed" - value: ${{ steps.check.outputs.version_changed }} - package_version: - description: "Current version from package.json" - value: ${{ steps.check.outputs.package_version }} - -runs: - using: composite - steps: - - name: Instalando Dependencias - shell: sh - run: apk add git jq - - - name: Checkout do repositório - uses: actions/checkout@v4 - with: - fetch-depth: 2 # Necessário para acessar o commit anterior - - - name: Verificar mudança de versão no package.json - id: check-package-version - shell: sh - run: | - OLD_VERSION=$(git show HEAD^:${{ inputs.package_json_path }} | jq -r '.version') - NEW_VERSION=$(jq -r '.version' ${{ inputs.package_json_path }}) - - echo "Versão anterior: $OLD_VERSION" - echo "Versão atual: $NEW_VERSION" - - if [ "$OLD_VERSION" != "$NEW_VERSION" ]; then - echo "version_changed=true" >> "$GITHUB_OUTPUT" - else - echo "version_changed=false" >> "$GITHUB_OUTPUT" - fi - - echo "package_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" - echo "PACKAGE_VERSION=$NEW_VERSION" >> "$GITHUB_ENV" diff --git a/.forgejo/actions/deploy-docker/action.yml b/.forgejo/actions/deploy-docker/action.yml index c4adb2e..4256390 100644 --- a/.forgejo/actions/deploy-docker/action.yml +++ b/.forgejo/actions/deploy-docker/action.yml @@ -36,12 +36,6 @@ runs: export SERVIDORES=`curl ${{ inputs.url-servidores }}` echo "Leandro Servidores: $SERVIDORES" echo $SERVIDORES >> servidores.lst - - - name: Set Image Name - uses: https://git.lhprovedor.com.br/leandro/devops/.forgejo/actions/set-image-name@main - with: - username: ${{ inputs.username }} - - name: deploy shell: sh run: | @@ -53,9 +47,9 @@ runs: ssh root@$IP -p $PORTA -o StrictHostKeyChecking=no -t " cd /lh && docker image prune --force && docker-compose pull --quiet lhisp-dbupdater && - docker-compose pull --quiet $IMAGE_NAME && + docker-compose pull --quiet ${{ env.IMAGE_NAME }} && docker-compose up -d --remove-orphans --force-recreate lhisp-dbupdater - docker-compose up -d --remove-orphans --force-recreate $IMAGE_NAME + docker-compose up -d --remove-orphans --force-recreate ${{ env.IMAGE_NAME }} " > $IP-$PORTA.log 2>&1 & done; wait diff --git a/.forgejo/actions/publish-npm-package/action.yaml b/.forgejo/actions/publish-npm-package/action.yaml deleted file mode 100644 index 5d22fdd..0000000 --- a/.forgejo/actions/publish-npm-package/action.yaml +++ /dev/null @@ -1,92 +0,0 @@ -name: Publish Package to NPM Repository -description: This action will verify if the package exists on the repository and publish to it if needed - -inputs: - npm_token: - description: NPM_TOKEN to access the repository - required: true - git_token: - description: Token to publish packages - required: true - package_owner: - description: user name that will hold the packages - required: false - default: Altsoft - git_url: - description: Git/Gitea/Forgejo server - required: false - default: git.lhprovedor.com.br - artifact_folder_name: - description: The Artifact to be downloaded - default: dist - required: false -outputs: - version_changed: - description: "Whether the version changed" - value: ${{ steps.check.outputs.version_changed }} - package_version: - description: "Current version from package.json" - value: ${{ steps.check.outputs.package_version }} - -runs: - using: composite - steps: - - name: Instalando Dependencias - shell: sh - run: apk add git jq sed - - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - path: ${{ inputs.artifact_folder_name }} - name: dist - - - name: Ajusta nome do pacote - if: github.ref == 'refs/heads/master' - shell: sh - run: sed -i "s/-dev//g" dist/package.json - - - name: Lê o nome do pacote - shell: sh - run: | - PACKAGE_NAME=$(jq -r .name dist/package.json) - PACKAGE_VERSION=$(jq -r .version dist/package.json) - - echo "Package Name: $PACKAGE_NAME" - echo "Package Version: $PACKAGE_VERSION" - - echo "PACKAGE_NAME=$PACKAGE_NAME" >> "$GITHUB_ENV" - echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_ENV" - - - name: Publish to NPM.js - shell: sh - run: | - cd dist - echo "//registry.npmjs.org/:_authToken=${{ inputs.npm_token }}" > ~/.npmrc - - if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" > /dev/null 2>&1; then - echo "Package ${PACKAGE_NAME}@${PACKAGE_VERSION} already exists. Skipping publish." - else - echo "Package ${PACKAGE_NAME}@${PACKAGE_VERSION} does not exist. Will publish." - npm publish - fi - - cd .. - - - name: Publish to Git Packages - shell: sh - run: | - echo "Git url: ${{ inputs.git_url }}" - echo "Package Owner: ${{ inputs.package_owner }}" - npm config set registry https://${{ inputs.git_url }}/api/packages/${{ inputs.package_owner }}/npm/ - npm config set -- '//${{ inputs.git_url }}/api/packages/${{ inputs.package_owner }}/npm/:_authToken' "${{ inputs.git_token }}" - cd dist - - if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" > /dev/null 2>&1; then - echo "Package ${PACKAGE_NAME}@${PACKAGE_VERSION} already exists. Skipping publish." - else - echo "Package ${PACKAGE_NAME}@${PACKAGE_VERSION} does not exist. Will publish." - npm publish - fi - - cd .. diff --git a/.vscode/settings.json b/.vscode/settings.json index c8e2e56..eb60b31 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "cSpell.words": ["Altsoft", "dbupdater", "lhprovedor", "npmjs", "webfactory"] + "cSpell.words": ["dbupdater", "lhprovedor", "webfactory"] }