chore: sequence diagrams #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "web-server (SW)" | |
on: push | |
# New pushes cancel in-progress builds. | |
concurrency: | |
group: ${{ github.workflow }} - ${{ github.job }} - ${{ github.ref }} | |
cancel-in-progress: true | |
# Action docs: | |
# | |
# - https://github.com/docker/build-push-action#readme | |
# - https://github.com/docker/login-action#readme | |
# - https://github.com/docker/metadata-action#readme | |
# - https://github.com/docker/setup-buildx-action#readme | |
# | |
# For the context paths, see: | |
# | |
# - Feature request: Allow specifying subdirectory with default git context #460 | |
# https://github.com/docker/build-push-action/issues/460 | |
jobs: | |
build-stage-web-server-builder: | |
name: "Builder" | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: docker/setup-buildx-action@v1 | |
- | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: "Build stage: web-server-builder" | |
uses: docker/build-push-action@v2 | |
with: | |
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:rust-sgx-workspace" | |
target: web-server-builder | |
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw | |
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max | |
build-stage-run-sgx-vault-server-sw: | |
name: "Build server (SW)" | |
runs-on: ubuntu-latest | |
needs: build-stage-web-server-builder | |
steps: | |
- | |
uses: docker/setup-buildx-action@v1 | |
- | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/sgx-vault-sw | |
- | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: "Build stage: run-sgx-vault-server-sw" | |
uses: docker/build-push-action@v2 | |
with: | |
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:rust-sgx-workspace" | |
build-args: 'SGX_MODE=SW' | |
secrets: | | |
"sgx-signing-key=${{ secrets.SGX_SIGNING_KEY }}" | |
target: run-sgx-vault-server-sw | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw | |
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max | |
build-stage-run-sgx-vault-test-sw: | |
name: "Build tests (SW)" | |
runs-on: ubuntu-latest | |
needs: build-stage-web-server-builder | |
steps: | |
- | |
uses: docker/setup-buildx-action@v1 | |
- | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: "Build image: run-sgx-vault-test-sw (SGX_MODE=SW)" | |
uses: docker/build-push-action@v2 | |
with: | |
context: "https://github.com/${{ github.repository }}.git#${{ github.sha }}:rust-sgx-workspace" | |
build-args: 'SGX_MODE=SW' | |
secrets: | | |
"sgx-signing-key=${{ secrets.SGX_SIGNING_KEY }}" | |
target: run-sgx-vault-test-sw | |
tags: run-sgx-vault-test-sw | |
outputs: type=docker,dest=/tmp/run-sgx-vault-test-sw.tar | |
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw | |
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-sw,mode=max | |
- | |
uses: actions/upload-artifact@v2 | |
with: | |
name: run-sgx-vault-test-sw | |
path: /tmp/run-sgx-vault-test-sw.tar | |
run-stage-sgx-vault-test-sw: | |
name: "Run tests (SW)" | |
runs-on: ubuntu-latest | |
needs: build-stage-run-sgx-vault-test-sw | |
steps: | |
- | |
uses: docker/setup-buildx-action@v1 | |
- | |
uses: actions/download-artifact@v2 | |
with: | |
name: run-sgx-vault-test-sw | |
path: /tmp | |
- | |
name: "Load image: run-sgx-vault-test-sw" | |
run: | | |
docker load --input /tmp/run-sgx-vault-test-sw.tar | |
- | |
name: "Run image: run-sgx-vault-test-sw" | |
run: | | |
docker run --rm run-sgx-vault-test-sw |