diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e0b3c2..97616c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: brdgm/github-action-build@main + - uses: brdgm/github-action-build@v1 with: sonar-token: ${{ secrets.SONARCLOUD_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0a6a0fc..f036748 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,41 +7,17 @@ on: workflow_dispatch: jobs: - build: + deploy: runs-on: ubuntu-latest environment: name: Production - url: "https://brdgm.me/${{ steps.package_json.outputs.appDeployName }}" + url: "https://brdgm.me/${{ steps.deploy.outputs.app-deploy-name }}" steps: - - uses: actions/checkout@v4 - - - name: Read properties from package.json - id: package_json - uses: zoexx/github-action-json-file-properties@1.0.6 - with: - file_path: package.json - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - - - run: npm ci - - run: npm run test:unit - - run: npm run build - - - name: Copy to Site - uses: cpina/github-action-push-to-another-repository@v1.7.2 - env: - API_TOKEN_GITHUB: ${{ secrets.GH_SITE_DEPLOY_PAT }} - with: - source-directory: dist - destination-repository-username: brdgm - destination-repository-name: brdgm.github.io - destination-github-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }} - user-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} - user-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} - target-branch: main - commit-message: deploy ${{ steps.package_json.outputs.appDeployName }} ${{ steps.package_json.outputs.version }} - target-directory: ${{ steps.package_json.outputs.appDeployName }} + - uses: brdgm/github-action-deploy@v1 + id: deploy + with: + gh-site-deploy-pat: ${{ secrets.GH_SITE_DEPLOY_PAT }} + gh-site-deploy-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }} + gh-site-deploy-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} + gh-site-deploy-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} \ No newline at end of file diff --git a/.github/workflows/gitflow-release.yml b/.github/workflows/gitflow-release.yml index 70dd364..641c088 100644 --- a/.github/workflows/gitflow-release.yml +++ b/.github/workflows/gitflow-release.yml @@ -1,77 +1,24 @@ -name: GitFlow Release +name: Release and Deploy on: workflow_dispatch: jobs: - build: + release: runs-on: ubuntu-latest environment: name: Production - url: "https://brdgm.me/${{ steps.package_json.outputs.appDeployName }}" + url: "https://brdgm.me/${{ steps.release.outputs.app-deploy-name }}" permissions: contents: write steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - - - run: npm ci - - run: npm run test:unit - - run: npm run build - - - name: Read properties from package.json - id: package_json - uses: zoexx/github-action-json-file-properties@1.0.6 - with: - file_path: package.json - - - name: set git config - run: | - git config user.name "GitHub Actions" - git config user.email noreply@github.com - - - name: Install git flow extensions - run: | - sudo apt-get install git-flow - - - run: git flow init --defaults - - run: git flow release start ${{ steps.package_json.outputs.version }} - - run: git flow release finish ${{ steps.package_json.outputs.version }} --push --message "Release" - - - name: Copy to Site - uses: cpina/github-action-push-to-another-repository@v1.7.2 - env: - API_TOKEN_GITHUB: ${{ secrets.GH_SITE_DEPLOY_PAT }} - with: - source-directory: dist - destination-repository-username: brdgm - destination-repository-name: brdgm.github.io - destination-github-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }} - user-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} - user-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} - target-branch: main - commit-message: deploy ${{ steps.package_json.outputs.appDeployName }} ${{ steps.package_json.outputs.version }} - target-directory: ${{ steps.package_json.outputs.appDeployName }} - - - name: set next version - run: | - npm --no-git-tag-version version patch - git config user.name "GitHub Actions" - git config user.email noreply@github.com - git add package.json package-lock.json - git commit --message "set next version" - git push - - - uses: ncipollo/release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ steps.package_json.outputs.version }} - generateReleaseNotes: true + - uses: brdgm/github-action-release@v1 + id: release + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + gh-site-deploy-pat: ${{ secrets.GH_SITE_DEPLOY_PAT }} + gh-site-deploy-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }} + gh-site-deploy-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }} + gh-site-deploy-name: ${{ secrets.GH_SITE_DEPLOY_NAME }} \ No newline at end of file