diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..65ffcf0e --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,35 @@ +name: CD + +on: + push: + branches: + - main + +permissions: + actions: read + contents: read + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + # Cache node_modules + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + - run: pnpm install --frozen-lockfile + - uses: nrwl/nx-set-shas@v4 + - name: Build and push images + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUT_PUSH: true + run: pnpm exec nx affected -t container diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45b3a09b..8f47fad8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,9 @@ name: CI on: - push: + pull_request: branches: - main - pull_request: permissions: actions: read @@ -29,7 +28,7 @@ jobs: cache: 'pnpm' - run: pnpm install --frozen-lockfile - uses: nrwl/nx-set-shas@v4 - - # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud - # - run: pnpm exec nx-cloud record -- echo Hello World - - run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} pnpm exec nx affected -t lint test build container + - name: Lint, test, build, and container + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: pnpm exec nx affected -t lint test build container