|
7 | 7 | pull_request: |
8 | 8 | branches: ["dev"] |
9 | 9 |
|
10 | | -env: |
11 | | - REGISTRY: ghcr.io |
12 | | - IMAGE_NAME: ${{ github.repository }} |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
13 | 13 |
|
14 | 14 | jobs: |
15 | 15 | tests: |
16 | | - name: Run tests |
17 | | - runs-on: ubuntu-latest |
18 | | - steps: |
19 | | - - uses: actions/checkout@v4 |
20 | | - - name: Setup PDM |
21 | | - uses: pdm-project/setup-pdm@v4 |
22 | | - with: |
23 | | - cache: true |
24 | | - - name: Install dependencies |
25 | | - run: pdm install -d |
26 | | - - name: Run linting check |
27 | | - run: pdm run lint --check |
28 | | - - name: Run tests |
29 | | - run: pdm run tests |
30 | | - - name: Export requirements |
31 | | - run: pdm run export |
32 | | - - name: Check for changes |
33 | | - if: contains(github.actor, 'renovate[bot]') == false |
34 | | - run: git diff --exit-code HEAD requirements.txt |
| 16 | + uses: ./.github/workflows/test.yaml |
| 17 | + |
35 | 18 | docker: |
36 | 19 | needs: tests |
37 | | - runs-on: ubuntu-latest |
38 | 20 | permissions: |
39 | 21 | contents: read |
40 | 22 | packages: write |
41 | 23 | id-token: write |
42 | | - steps: |
43 | | - - name: Checkout repository |
44 | | - uses: actions/checkout@v4 |
45 | | - |
46 | | - - name: Set up Docker Buildx |
47 | | - uses: docker/setup-buildx-action@v3.4.0 |
48 | | - |
49 | | - - name: Log into registry ${{ env.REGISTRY }} |
50 | | - uses: docker/login-action@v3.2.0 |
51 | | - with: |
52 | | - registry: ${{ env.REGISTRY }} |
53 | | - username: ${{ github.actor }} |
54 | | - password: ${{ secrets.GITHUB_TOKEN }} |
55 | | - |
56 | | - - name: Extract Docker metadata for |
57 | | - id: meta |
58 | | - uses: docker/metadata-action@v5.5.1 |
59 | | - with: |
60 | | - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
61 | | - tags: | |
62 | | - type=ref,event=branch |
63 | | - type=ref,event=pr |
64 | | - type=ref,event=tag |
65 | | - type=sha |
66 | | -
|
67 | | - - name: Build and push Docker image |
68 | | - uses: docker/build-push-action@v6.3.0 |
69 | | - with: |
70 | | - context: . |
71 | | - push: true |
72 | | - tags: ${{ steps.meta.outputs.tags }} |
73 | | - labels: ${{ steps.meta.outputs.labels }} |
74 | | - cache-from: type=gha |
75 | | - cache-to: type=gha,mode=max |
| 24 | + uses: ./.github/workflows/docker.yaml |
0 commit comments