|
42 | 42 | echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT |
43 | 43 | echo "package=$(node -p "require('./package.json').name")" >> $GITHUB_OUTPUT |
44 | 44 |
|
45 | | - - name: Run core tests |
46 | | - run: npm run test:core |
47 | | - |
48 | 45 | - name: Upload core package |
49 | 46 | uses: actions/upload-artifact@v4 |
50 | 47 | with: |
|
86 | 83 | cd server |
87 | 84 | echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT |
88 | 85 |
|
89 | | - - name: Run server tests |
90 | | - run: npm run test:server |
91 | | - |
92 | 86 | - name: Upload server artifacts |
93 | 87 | uses: actions/upload-artifact@v4 |
94 | 88 | with: |
|
98 | 92 | dist/ |
99 | 93 | retention-days: 7 |
100 | 94 |
|
| 95 | + build-docker: |
| 96 | + name: Build & Push Docker Image |
| 97 | + runs-on: ubuntu-latest |
| 98 | + needs: [build-core, build-server] |
| 99 | + permissions: |
| 100 | + contents: read |
| 101 | + packages: write |
| 102 | + steps: |
| 103 | + - name: Checkout repository |
| 104 | + uses: actions/checkout@v4 |
| 105 | + |
| 106 | + - name: Set up QEMU |
| 107 | + uses: docker/setup-qemu-action@v3 |
| 108 | + |
| 109 | + - name: Set up Docker Buildx |
| 110 | + uses: docker/setup-buildx-action@v3 |
| 111 | + |
| 112 | + - name: Log in to GitHub Container Registry |
| 113 | + uses: docker/login-action@v3 |
| 114 | + with: |
| 115 | + registry: ghcr.io |
| 116 | + username: ${{ github.actor }} |
| 117 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 118 | + |
| 119 | + - name: Extract metadata for Docker |
| 120 | + id: meta |
| 121 | + uses: docker/metadata-action@v5 |
| 122 | + with: |
| 123 | + images: ghcr.io/${{ github.repository_owner }}/ldap-gateway |
| 124 | + tags: | |
| 125 | + type=semver,pattern={{version}} |
| 126 | + type=semver,pattern={{major}}.{{minor}} |
| 127 | + type=semver,pattern={{major}} |
| 128 | + type=ref,event=branch |
| 129 | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} |
| 130 | + type=sha,prefix= |
| 131 | +
|
| 132 | + - name: Build and push Docker image |
| 133 | + uses: docker/build-push-action@v5 |
| 134 | + with: |
| 135 | + context: . |
| 136 | + file: server/test/e2e/Dockerfile.server |
| 137 | + platforms: linux/amd64,linux/arm64 |
| 138 | + push: ${{ github.event_name != 'pull_request' }} |
| 139 | + tags: ${{ steps.meta.outputs.tags }} |
| 140 | + labels: ${{ steps.meta.outputs.labels }} |
| 141 | + cache-from: type=gha |
| 142 | + cache-to: type=gha,mode=max |
| 143 | + |
101 | 144 | build-packages: |
102 | 145 | name: Build Distribution Packages |
103 | 146 | runs-on: ubuntu-latest |
|
0 commit comments