From 9f68304b7ffbc89cb75f669bff642a6e08c2a506 Mon Sep 17 00:00:00 2001 From: Peter Karolyi Date: Sat, 27 Apr 2024 16:31:57 +0200 Subject: [PATCH] test actiosn --- .github/workflows/ci.yml | 28 ----------- .github/workflows/docker.yml | 29 ----------- .github/workflows/push_main.yml | 89 +++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/push_main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index fd016dc..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Lint, Build, Test - -on: - push: - branches: ["main"] - pull_request: - branches: ["main"] - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 - - uses: actions/setup-node@v4 - with: - node-version: "20.12" - cache: "pnpm" - - name: Install dependencies - run: pnpm install - - name: Lint - run: pnpm lint - - name: Build - run: pnpm build - - name: Test - run: pnpm test:cov - - name: Test e2e - run: pnpm test:e2e diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 10ee284..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Publish Docker image - -on: - push: - branches: ["main"] - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/metadata-action@v5 - id: meta - with: - images: pkarolyi/garden-snail - - 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/.github/workflows/push_main.yml b/.github/workflows/push_main.yml new file mode 100644 index 0000000..1cb5d07 --- /dev/null +++ b/.github/workflows/push_main.yml @@ -0,0 +1,89 @@ +name: โš’๏ธ build ๐Ÿงช test ๐Ÿš€ deploy + +on: + push: + branches: ["main", "action-test"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version: "20.12" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + lint: + runs-on: ubuntu-22.04 + needs: build + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version: "20.12" + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Lint + run: pnpm lint + test: + runs-on: ubuntu-22.04 + needs: build + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - 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: + runs-on: ubuntu-22.04 + needs: build + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - 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 + push_to_registry: + name: Push Docker image to Docker Hub + needs: [build, lint, test, test-e2e] + runs-on: ubuntu-latest + steps: + - uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/metadata-action@v5 + id: meta + with: + images: pkarolyi/garden-snail + - uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}