Skip to content

Commit

Permalink
No longer push images to CCF ACR
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Maffre committed Aug 11, 2023
1 parent eb9d63b commit 1d8074a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 100 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ concurrency:
cancel-in-progress: true

env:
ACR_REGISTRY: ccfmsrc.azurecr.io
DOCKER_BUILDKIT: 1 # https://docs.docker.com/develop/develop-images/build_enhancements/

jobs:
Expand Down Expand Up @@ -56,7 +55,7 @@ jobs:
fetch-depth: 0

- name: Build container
run: docker build -t $ACR_REGISTRY/public/lskv:latest-virtual -f Dockerfile.virtual .
run: docker build -t lskv:latest-virtual -f Dockerfile.virtual .

build-docker-sgx:
runs-on: ubuntu-20.04
Expand All @@ -68,7 +67,7 @@ jobs:
fetch-depth: 0

- name: Build container
run: docker build -t $ACR_REGISTRY/public/lskv:latest-sgx -f Dockerfile.sgx .
run: docker build -t lskv:latest-sgx -f Dockerfile.sgx .

checks:
runs-on: ubuntu-latest
Expand Down
56 changes: 7 additions & 49 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

env:
ACR_REGISTRY: ccfmsrc.azurecr.io
ACR_TOKEN_NAME: lskv-push-token
DOCKER_BUILDKIT: 1 # https://docs.docker.com/develop/develop-images/build_enhancements/

jobs:
publish-docker-virtual:
publish:
runs-on: ubuntu-20.04

steps:
Expand All @@ -22,58 +20,18 @@ jobs:
with:
fetch-depth: 0

- name: Build container
run: docker build -t $ACR_REGISTRY/public/lskv:latest-virtual -f Dockerfile.virtual .

- name: Log in to registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_LSKV_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Push virtual image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: docker push $ACR_REGISTRY/public/lskv:latest-virtual

publish-docker-sgx:
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build container
run: docker build -t $ACR_REGISTRY/public/lskv:latest-sgx -f Dockerfile.sgx .

- name: Log in to registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_LSKV_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Push sgx image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: docker push $ACR_REGISTRY/public/lskv:latest-sgx

publish-binaries:
runs-on: ubuntu-20.04
needs:
- publish-docker-virtual
- publish-docker-sgx
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download images
run: |
docker pull $ACR_REGISTRY/public/lskv:latest-virtual
docker pull $ACR_REGISTRY/public/lskv:latest-sgx
- name: Build containers
run: |
docker build -t lskv:latest-virtual -f Dockerfile.virtual .
docker build -t lskv:latest-sgx -f Dockerfile.sgx .
- name: Copy files out of images
run: |
docker create --name lskv-virtual $ACR_REGISTRY/public/lskv:latest-virtual
docker create --name lskv-virtual lskv:latest-virtual
docker cp lskv-virtual:/app/liblskv.virtual.so liblskv.virtual.so
docker rm lskv-virtual
docker create --name lskv-sgx $ACR_REGISTRY/public/lskv:latest-sgx
docker create --name lskv-sgx lskv:latest-sgx
docker cp lskv-sgx:/app/liblskv.enclave.so.signed liblskv.enclave.so.signed
docker rm lskv-sgx
Expand Down
58 changes: 10 additions & 48 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+*"

env:
ACR_REGISTRY: ccfmsrc.azurecr.io
ACR_TOKEN_NAME: lskv-push-token
DOCKER_BUILDKIT: 1 # https://docs.docker.com/develop/develop-images/build_enhancements/

jobs:
publish-docker-virtual:
publish:
runs-on: ubuntu-20.04

steps:
Expand All @@ -20,62 +18,26 @@ jobs:
with:
fetch-depth: 0

- name: Build container
run: docker build -t $ACR_REGISTRY/public/lskv:${{ github.ref }}-virtual -f Dockerfile.virtual .

- name: Log in to registry
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_LSKV_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Push virtual image
run: docker push $ACR_REGISTRY/public/lskv:${{ github.ref }}-virtual

publish-docker-sgx:
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build container
run: docker build -t $ACR_REGISTRY/public/lskv:${{ github.ref }}-sgx -f Dockerfile.sgx .

- name: Log in to registry
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_LSKV_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Push sgx image
run: docker push $ACR_REGISTRY/public/lskv:${{ github.ref }}-sgx

publish-binaries:
runs-on: ubuntu-20.04
needs:
- publish-docker-virtual
- publish-docker-sgx
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download images
run: |
docker pull $ACR_REGISTRY/public/lskv:${{ github.ref }}-virtual
docker pull $ACR_REGISTRY/public/lskv:${{ github.ref }}-sgx
- name: Build containers
run: |
docker build -t lskv:${{ github.ref }}-virtual -f Dockerfile.virtual .
docker build -t lskv:${{ github.ref }}-sgx -f Dockerfile.sgx .
- name: Copy files out of images
run: |
docker create --name lskv-virtual $ACR_REGISTRY/public/lskv:${{ github.ref }}-virtual
docker create --name lskv-virtual lskv:${{ github.ref }}-virtual
docker cp lskv-virtual:/app/liblskv.virtual.so liblskv.virtual.so
docker rm lskv-virtual
docker create --name lskv-sgx $ACR_REGISTRY/public/lskv:${{ github.ref }}-sgx
docker create --name lskv-sgx lskv:${{ github.ref }}-sgx
docker cp lskv-sgx:/app/liblskv.enclave.so.signed liblskv.enclave.so.signed
docker rm lskv-sgx
- name: Publish ${{ github.ref }} release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref }}
tag_name: ${{ github.ref }}
files: |
liblskv.virtual.so
liblskv.enclave.so.signed
liblskv.enclave.so.signed

0 comments on commit 1d8074a

Please sign in to comment.