diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 86a84df..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Lint Deno Project - -on: - - push - - pull_request - -permissions: - contents: read - -jobs: - lint: - runs-on: ubuntu-latest - - env: - DENO_DIR: .deno - - steps: - - name: Git Checkout - uses: actions/checkout@v2 - - - name: Use Deno Version - uses: denolib/setup-deno@v2 - with: - deno-version: 2.1.2 - - - name: Format all files - run: deno fmt --check - - - name: Lint project - run: deno lint diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..adca954 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,57 @@ +name: Lint Deno Project + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + + env: + DENO_DIR: .deno + + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Use Deno Version + uses: denolib/setup-deno@v2 + with: + deno-version: 2.1.2 + + - name: Format all files + run: deno fmt --check + + - name: Lint project + run: deno lint + + build-api: + needs: lint + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: https://ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push API Docker image + uses: docker/build-push-action@v5 + with: + context: . + dockerfile: ./apps/api/Dockerfile + push: true + tags: | + ghcr.io/finxol/karr-api:latest + ghcr.io/finxol/karr-api:${{ github.sha }}