|
| 1 | +# Demo images (Bank sample service and Studio demo console) on GitHub Container Registry. |
| 2 | +# Tags: the branch name, the short commit SHA and v3-latest (the tag docker-compose.yml pulls by default). |
| 3 | +name: v3-images |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ "v3.0.0", "v3/**" ] |
| 8 | + paths: |
| 9 | + - "src/Core/**" |
| 10 | + - "src/Hosting/**" |
| 11 | + - "src/Storage/SourceFlow.Storage.PostgreSQL/**" |
| 12 | + - "samples/**" |
| 13 | + - "Directory.Build.props" |
| 14 | + - "Directory.Build.targets" |
| 15 | + - "Directory.Packages.props" |
| 16 | + - "global.json" |
| 17 | + - ".dockerignore" |
| 18 | + - ".github/workflows/v3-images.yml" |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + packages: write |
| 24 | + |
| 25 | +concurrency: |
| 26 | + group: v3-images-${{ github.ref }} |
| 27 | + cancel-in-progress: true |
| 28 | + |
| 29 | +jobs: |
| 30 | + image: |
| 31 | + name: ${{ matrix.image }} |
| 32 | + runs-on: ubuntu-latest |
| 33 | + strategy: |
| 34 | + fail-fast: false |
| 35 | + matrix: |
| 36 | + include: |
| 37 | + - image: sourceflow-bank-api |
| 38 | + dockerfile: samples/Bank/Bank.Api/Dockerfile |
| 39 | + - image: sourceflow-studio-demo |
| 40 | + dockerfile: samples/Studio/SourceFlow.Studio.Demo/Dockerfile |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Image name |
| 45 | + id: name |
| 46 | + run: echo "image=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${{ matrix.image }}" >> "$GITHUB_OUTPUT" |
| 47 | + |
| 48 | + - uses: docker/setup-qemu-action@v3 |
| 49 | + - uses: docker/setup-buildx-action@v3 |
| 50 | + |
| 51 | + - uses: docker/login-action@v3 |
| 52 | + with: |
| 53 | + registry: ghcr.io |
| 54 | + username: ${{ github.actor }} |
| 55 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + |
| 57 | + - id: meta |
| 58 | + uses: docker/metadata-action@v5 |
| 59 | + with: |
| 60 | + images: ${{ steps.name.outputs.image }} |
| 61 | + tags: | |
| 62 | + type=ref,event=branch |
| 63 | + type=sha,format=short |
| 64 | + type=raw,value=v3-latest |
| 65 | +
|
| 66 | + - uses: docker/build-push-action@v6 |
| 67 | + with: |
| 68 | + context: . |
| 69 | + file: ${{ matrix.dockerfile }} |
| 70 | + platforms: linux/amd64,linux/arm64 |
| 71 | + push: true |
| 72 | + tags: ${{ steps.meta.outputs.tags }} |
| 73 | + labels: ${{ steps.meta.outputs.labels }} |
| 74 | + cache-from: type=gha,scope=${{ matrix.image }} |
| 75 | + cache-to: type=gha,mode=max,scope=${{ matrix.image }} |
0 commit comments