From 4881561d8ba8087cb8435fedf09958223df66590 Mon Sep 17 00:00:00 2001 From: Vinicius Mayrink <63162394+vncsmyrnk@users.noreply.github.com> Date: Sat, 26 Oct 2024 11:29:35 -0300 Subject: [PATCH] chore(workflows): drops versioning releases (#43) * chore(workflows): deploying the main branch * chore(workflows): force running on any update for testing * chore(workflows): force running on any branch update * fix: any branch * fix(workflows): job dependency * chore(workflows): adds correct branch constraints; renames ci workflow * chore(workflows): removes unnecesary release workflow --- .github/workflows/ci-cd.yml | 67 ++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 37 ------------------- .github/workflows/release.yml | 68 ----------------------------------- 3 files changed, 67 insertions(+), 105 deletions(-) create mode 100644 .github/workflows/ci-cd.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..b391551 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,67 @@ +name: CI/CD workflow + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + ci: + runs-on: ubuntu-latest + container: node:21-alpine + defaults: + run: + working-directory: ./app + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: extractions/setup-just@v1 + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build project + run: just build + + - name: Archive production artifacts + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v4 + with: + name: app + path: | + ./app/dist + !./app/dist/**/*.md + + deploy: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: ci + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: app + + - name: List artifact files + run: ls + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload to pages + uses: actions/upload-pages-artifact@v3 + with: + path: ./ + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 09d4092..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI workflow - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - ci: - runs-on: ubuntu-latest - container: node:21-alpine - defaults: - run: - working-directory: ./app - steps: - - name: Checkout - uses: actions/checkout@v4 - - - uses: extractions/setup-just@v1 - - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Build project - run: just build - - - name: Archive production artifacts - if: github.ref == 'refs/heads/main' - uses: actions/upload-artifact@v4 - with: - name: app - path: | - ./app/dist - !./app/dist/**/*.md - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ed50bb9..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Release workflow - -on: - push: - tags: - - '*' - -permissions: - contents: write - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build Changelog - id: github_release - uses: mikepenz/release-changelog-builder-action@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: | - ## Changelog - - ${{ steps.github_release.outputs.changelog }} - draft: false - prerelease: false - - deploy: - runs-on: ubuntu-latest - needs: release - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Download artifact - id: download-artifact - uses: dawidd6/action-download-artifact@v3 - with: - name: app - workflow: ci.yml - - - run: ls - - - name: Setup Pages - uses: actions/configure-pages@v3 - - - name: Upload to pages - uses: actions/upload-pages-artifact@v3 - with: - path: ./ - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4