|
| 1 | +name: Docker |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + tags: |
| 8 | + - "v*" |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + permissions: |
| 14 | + contents: read |
| 15 | + packages: write |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: docker/setup-buildx-action@v3 |
| 19 | + - uses: docker/login-action@v3 |
| 20 | + with: |
| 21 | + registry: ghcr.io |
| 22 | + username: ${{ github.repository_owner }} |
| 23 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + - id: meta-api |
| 25 | + uses: docker/metadata-action@v5 |
| 26 | + with: |
| 27 | + images: ghcr.io/${{ github.repository_owner }}/vibhaag-api |
| 28 | + tags: | |
| 29 | + type=sha |
| 30 | + type=raw,value=latest,enable={{is_default_branch}} |
| 31 | + type=ref,event=tag |
| 32 | + type=semver,pattern={{version}} |
| 33 | + type=semver,pattern={{major}}.{{minor}} |
| 34 | + type=semver,pattern={{major}} |
| 35 | + - uses: docker/build-push-action@v5 |
| 36 | + with: |
| 37 | + context: . |
| 38 | + file: infra/docker/api.Dockerfile |
| 39 | + push: true |
| 40 | + tags: ${{ steps.meta-api.outputs.tags }} |
| 41 | + labels: ${{ steps.meta-api.outputs.labels }} |
| 42 | + - id: meta-web |
| 43 | + uses: docker/metadata-action@v5 |
| 44 | + with: |
| 45 | + images: ghcr.io/${{ github.repository_owner }}/vibhaag-web |
| 46 | + tags: | |
| 47 | + type=sha |
| 48 | + type=raw,value=latest,enable={{is_default_branch}} |
| 49 | + type=ref,event=tag |
| 50 | + type=semver,pattern={{version}} |
| 51 | + type=semver,pattern={{major}}.{{minor}} |
| 52 | + type=semver,pattern={{major}} |
| 53 | + - uses: docker/build-push-action@v5 |
| 54 | + with: |
| 55 | + context: . |
| 56 | + file: infra/docker/web.Dockerfile |
| 57 | + push: true |
| 58 | + tags: ${{ steps.meta-web.outputs.tags }} |
| 59 | + labels: ${{ steps.meta-web.outputs.labels }} |
0 commit comments