chore: enable image rebuild from workflow dispatch #69
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Quality and Build | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, labeled] | |
| push: | |
| branches: [main] | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-22.04 | |
| name: Linting | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| node -v && yarn -v && yarn install --immutable && \ | |
| git status | |
| - name: Prettier | |
| run: | | |
| yarn format:check | |
| - name: Linting | |
| run: | | |
| yarn lint:check | |
| test: | |
| runs-on: ubuntu-22.04 | |
| name: Testing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| node -v && yarn -v && yarn install --immutable && \ | |
| git status | |
| - name: NestJS build | |
| run: | | |
| yarn build | |
| - name: Unit testing | |
| run: | | |
| yarn test | |
| - name: End-to-end testing | |
| run: | | |
| yarn test:e2e | |
| build: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | |
| needs: [lint, test] | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| uses: ./.github/actions/docker-build | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| image_name: "${{ github.repository }}/server" | |
| context: ./ | |
| dockerfile: "Dockerfile" | |
| docker_user: ${{ github.actor }} | |
| docker_password: ${{ secrets.GITHUB_TOKEN }} | |