diff --git a/.github/workflows/push_main.yml b/.github/workflows/push_main.yml index 8b33de2..5f8b05a 100644 --- a/.github/workflows/push_main.yml +++ b/.github/workflows/push_main.yml @@ -1,4 +1,4 @@ -name: Build, Test and Publish +name: Build, Test and Publish edge on: push: @@ -93,8 +93,8 @@ jobs: run: docker compose build - name: Test API with turborepo run: docker compose run test - build-push-docker: - name: Build and Push Docker + publish-edge-image: + name: Build and Push 'edge' to Dockerhub runs-on: ubuntu-22.04 needs: [build, lint, test, test-e2e, test-integration] steps: diff --git a/.github/workflows/push_tag.yml b/.github/workflows/push_tag.yml new file mode 100644 index 0000000..c44e428 --- /dev/null +++ b/.github/workflows/push_tag.yml @@ -0,0 +1,123 @@ +name: Build, Test and Publish tagged version + +on: + push: + tags: ["v**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.12" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + lint: + name: Lint + runs-on: ubuntu-22.04 + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.12" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Lint + run: pnpm lint + test: + name: Test (unit) + runs-on: ubuntu-22.04 + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.12" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Test + run: pnpm test:cov + test-e2e: + name: Test (e2e) + runs-on: ubuntu-22.04 + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.12" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Test e2e + run: pnpm test:e2e + test-integration: + name: Test (integration) + runs-on: ubuntu-22.04 + needs: [build, lint, test, test-e2e] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up buildx + uses: docker/setup-buildx-action@v3 + - name: Build docker images + run: docker compose build + - name: Test API with turborepo + run: docker compose run test + publish-tagged-image: + name: Build and Push 'x.y.z' to Dockerhub + runs-on: ubuntu-22.04 + needs: [build, lint, test, test-e2e, test-integration] + steps: + - name: Login to Dockerhub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up buildx + uses: docker/setup-buildx-action@v3 + - name: Collect image metadata + uses: docker/metadata-action@v5 + id: meta + with: + images: pkarolyi/garden-snail + tags: type=semver,pattern={{version}} + - name: Build and push image to Dockerhub + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/package.json b/package.json index f75ae38..2615628 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "garden-snail", - "version": "0.0.1", + "version": "1.0.0", "description": "Turborepo remote cache server", "author": "Peter Karolyi ", "private": true,