|
| 1 | +name: Release Server API Image |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: |
| 5 | + - published |
| 6 | +jobs: |
| 7 | + |
| 8 | + publish-docker: |
| 9 | + name: Generating Docker |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout repository |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Get version without v character |
| 16 | + id: version |
| 17 | + run: | |
| 18 | + VERSION=${{github.event.release.tag_name}} |
| 19 | + VERSION_WITHOUT_V=${VERSION:1} |
| 20 | + echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT |
| 21 | +
|
| 22 | + - name: Set Up QEMU |
| 23 | + uses: docker/setup-qemu-action@v2 |
| 24 | + |
| 25 | + - name: Set Up Docker Buildx |
| 26 | + uses: docker/setup-buildx-action@v2 |
| 27 | + |
| 28 | + - name: Login to Docker Hub |
| 29 | + uses: docker/login-action@v2 |
| 30 | + with: |
| 31 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 32 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 33 | + |
| 34 | + - name: Build and Push Docker Image |
| 35 | + uses: docker/build-push-action@v4 |
| 36 | + with: |
| 37 | + context: . |
| 38 | + file: ./src/apps/api/Dockerfile |
| 39 | + push: true |
| 40 | + tags: | |
| 41 | + asyncapi/server-api:${{ steps.version.outputs.value }} |
| 42 | + asyncapi/server-api:latest |
| 43 | + platforms: linux/amd64,linux/arm64 |
| 44 | + cache-from: type=gha |
| 45 | + cache-to: type=gha |
| 46 | + |
| 47 | + - uses: meeDamian/sync-readme@82715041300710d9be7c726c9d6c683b70451087 #version 1.0.6 https://github.com/meeDamian/sync-readme/releases/tag/v1.0.6 |
| 48 | + with: |
| 49 | + user: ${{secrets.DOCKER_USERNAME}} |
| 50 | + pass: ${{ secrets.DOCKER_PASSWORD }} |
| 51 | + slug: asyncapi/server-api |
| 52 | + readme: ./src/apps/api/README.md |
| 53 | + description: Server API providing official AsyncAPI tools |
| 54 | + |
| 55 | + deploy-app: |
| 56 | + name: Deploy to DigitalOcean App |
| 57 | + needs: publish-docker |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - name: Deploy to DigitalOcean App |
| 61 | + uses: digitalocean/app_action@e583e1b463e8ac378854c0a01af1de8a5afd836b |
| 62 | + with: |
| 63 | + app_name: "server-api" |
| 64 | + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
| 65 | + images: '[{"name":"asyncapi-server-api","image":{"registry_type":"DOCKER_HUB","registry":"asyncapi","repository":"server-api","tag":"latest"}}]' |
0 commit comments