|
| 1 | +name: Publish Digma release |
| 2 | + |
| 3 | +# Controls when the workflow will run |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + release: |
| 7 | + types: [released] |
| 8 | + |
| 9 | +# permissions are needed if pushing to ghcr.io |
| 10 | +permissions: |
| 11 | + packages: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + name: Build Jaeger UI |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - uses: actions/setup-node@v3 |
| 21 | + with: |
| 22 | + cache: yarn |
| 23 | + node-version: '16' |
| 24 | + - run: yarn install --frozen-lockfile |
| 25 | + - run: yarn lint |
| 26 | + - run: yarn build |
| 27 | + |
| 28 | + - uses: actions/upload-artifact@v3 |
| 29 | + with: |
| 30 | + name: jaeger-build |
| 31 | + path: packages/jaeger-ui/build/ |
| 32 | + |
| 33 | + - uses: actions/upload-artifact@v3 |
| 34 | + with: |
| 35 | + name: nginx-config |
| 36 | + path: nginx.conf.template |
| 37 | + |
| 38 | + - uses: actions/upload-artifact@v3 |
| 39 | + with: |
| 40 | + name: dockerfile |
| 41 | + path: Dockerfile |
| 42 | + |
| 43 | + download: |
| 44 | + name: Build and push Docker image |
| 45 | + needs: [build] |
| 46 | + runs-on: ubuntu-latest |
| 47 | + |
| 48 | + steps: |
| 49 | + - uses: actions/download-artifact@v3 |
| 50 | + with: |
| 51 | + name: jaeger-build |
| 52 | + path: build |
| 53 | + |
| 54 | + - uses: actions/download-artifact@v3 |
| 55 | + with: |
| 56 | + name: nginx-config |
| 57 | + |
| 58 | + - uses: actions/download-artifact@v3 |
| 59 | + with: |
| 60 | + name: dockerfile |
| 61 | + |
| 62 | + # https://github.com/docker/setup-qemu-action |
| 63 | + - name: Set up QEMU |
| 64 | + uses: docker/setup-qemu-action@v2 |
| 65 | + |
| 66 | + # https://github.com/docker/setup-buildx-action |
| 67 | + - name: Set up Docker Buildx |
| 68 | + id: buildx |
| 69 | + uses: docker/setup-buildx-action@v2 |
| 70 | + |
| 71 | + - name: Login to Docker Hub |
| 72 | + uses: docker/login-action@v2 |
| 73 | + with: |
| 74 | + username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }} |
| 75 | + password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }} |
| 76 | + |
| 77 | + - name: Docker meta |
| 78 | + id: metadata # you'll use this in the next step |
| 79 | + uses: docker/metadata-action@v4 |
| 80 | + with: |
| 81 | + # list of Docker images to use as base name for tags |
| 82 | + images: digmaai/jaeger-ui |
| 83 | + # Docker tags based on the following events/attributes |
| 84 | + tags: | |
| 85 | + type=schedule |
| 86 | + type=ref,event=branch |
| 87 | + type=ref,event=pr |
| 88 | + type=semver,pattern={{version}} |
| 89 | + type=semver,pattern={{major}}.{{minor}} |
| 90 | + type=semver,pattern={{major}} |
| 91 | + type=sha |
| 92 | + # set latest tag for digma branch |
| 93 | + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }} |
| 94 | +
|
| 95 | + - name: Build and push |
| 96 | + uses: docker/build-push-action@v4 |
| 97 | + with: |
| 98 | + context: . |
| 99 | + file: ./Dockerfile |
| 100 | + platforms: linux/amd64,linux/arm64 |
| 101 | + push: ${{ github.event_name != 'pull_request' }} |
| 102 | + tags: ${{ steps.metadata.outputs.tags }} |
| 103 | + labels: ${{ steps.metadata.outputs.labels }} |
0 commit comments