Skip to content

Commit

Permalink
- reimplement docker
Browse files Browse the repository at this point in the history
  • Loading branch information
nshyrei committed Apr 9, 2024
1 parent 7c3bb04 commit 214348e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 9 deletions.
67 changes: 58 additions & 9 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,82 @@ on:
- 'docker/parent-base/**'
pull_request:
branches: [ "master" ]
types:
- closed
paths:
- 'docker/enclave-base/**'
- 'docker/parent-base/**'

jobs:
build-and-publish:
build-docker-images:
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request' && github.event.action == 'opened'
steps:
- name: Pull main repository
uses: actions/checkout@v3
with:
repository: fortanix/salmiac

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export enclave-base
uses: docker/build-push-action@v5
with:
context: .
file: docker/enclave-base/Dockerfile
tags: fortanix/enclave-base:latest
outputs: type=docker,dest=/tmp/enclave-base.tar

- name: Upload enclave-base artifact
uses: actions/upload-artifact@v3
with:
name: enclave-base
path: /tmp/enclave-base.tar

- name: Build and export parent-base
uses: docker/build-push-action@v5
with:
context: .
file: docker/parent-base/Dockerfile
tags: fortanix/parent-base:latest
outputs: type=docker,dest=/tmp/parent-base.tar

- name: Upload parent-base artifact
uses: actions/upload-artifact@v3
with:
name: parent-base
path: /tmp/parent-base.tar

push-docker-images:
runs-on: ubuntu-20.04
needs: build-docker-images
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Download enclave-base artifact
uses: actions/download-artifact@v3
with:
name: enclave-base
path: /tmp/enclave-base.tar
- name: Load enclave-base image
run: |
docker load --input /tmp/enclave-base.tar
- name: Download parent-base artifact
uses: actions/download-artifact@v3
with:
name: parent-base
path: /tmp/parent-base.tar
- name: Load parent-base image
run: |
docker load --input /tmp/parent-base.tar
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build docker images
run: |
cd docker/enclave-base
docker build -t fortanix/enclave-base .
cd ../parent-base
docker build -t fortanix/parent-base .
- name: Push docker images
run: |
docker push fortanix/enclave-base
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 214348e

Please sign in to comment.