|
| 1 | +name: continuous integration - logistics |
| 2 | + |
| 3 | +concurrency: |
| 4 | + group: logistics |
| 5 | + cancel-in-progress: true |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + push: |
| 10 | + branches: ["*"] |
| 11 | + paths: ["./apps/logistics"] |
| 12 | + |
| 13 | +env: |
| 14 | + REGISTRY: ghcr.io |
| 15 | + |
| 16 | +jobs: |
| 17 | + continuous-integration: |
| 18 | + name: continuous integration |
| 19 | + runs-on: ubuntu-latest |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + packages: write |
| 23 | + steps: |
| 24 | + - name: checkout |
| 25 | + uses: actions/checkout@v3 |
| 26 | + |
| 27 | + - name: setup node.js |
| 28 | + uses: actions/setup-node@v3 |
| 29 | + with: |
| 30 | + node-version: 18 |
| 31 | + |
| 32 | + - name: install dependencies |
| 33 | + run: npm install |
| 34 | + working-directory: ./apps/logistics |
| 35 | + |
| 36 | + - name: build |
| 37 | + run: npm run build |
| 38 | + working-directory: ./apps/logistics |
| 39 | + |
| 40 | + - name: test |
| 41 | + run: npm test |
| 42 | + working-directory: ./apps/logistics |
| 43 | + |
| 44 | + - name: docker metadata |
| 45 | + id: meta |
| 46 | + uses: docker/metadata-action@v4 |
| 47 | + with: |
| 48 | + images: ghcr.io/amplication/example-kubernetes-deployment/logistics |
| 49 | + flavor: latest=true |
| 50 | + tags: | |
| 51 | + type=sha,prefix=sha- |
| 52 | + type=ref,event=branch |
| 53 | + type=ref,event=pr,prefix=pr- |
| 54 | + type=ref,event=tag,prefix=tag- |
| 55 | + type=raw,value=${{ github.run_id }},prefix=gh- |
| 56 | +
|
| 57 | + - name: login to image repostiory |
| 58 | + uses: docker/login-action@v2 |
| 59 | + with: |
| 60 | + registry: ${{ env.REGISTRY }} |
| 61 | + username: amplication |
| 62 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + |
| 64 | + - name: build and push |
| 65 | + uses: docker/build-push-action@v3 |
| 66 | + with: |
| 67 | + context: ./apps/logistics |
| 68 | + file: ./apps/logistics/Dockerfile |
| 69 | + push: true |
| 70 | + tags: ${{ steps.meta.outputs.tags }} |
| 71 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments