Merge pull request #428 from skalenetwork/develop #2316
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: Build and push SGX container | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
steps: | |
- name: Fail, if older Github Actions machine. Click "Re-run jobs" | |
run: cat /proc/cpuinfo | grep avx512 | |
- name: Login to docker | |
run: docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} | |
- uses: actions/checkout@v1 | |
- name: submodule update | |
run: git submodule update --init --recursive | |
- name: build and deploy test image | |
run: python3 scripts/docker_build.py Dockerfile sgxwallet ${GITHUB_SHA} | |
- name: deploy docker image | |
if: | | |
contains(github.ref, 'develop') || contains(github.ref, 'beta') || | |
contains(github.ref, 'master') || | |
contains(github.ref, 'SECURE_ENCLAVE_CHANGES') | |
run : | | |
export BRANCH=${GITHUB_REF##*/} | |
echo "Branch $BRANCH" | |
export VERSION=$(cat VERSION) | |
echo "Version $VERSION" | |
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION) | |
echo "::set-env name=VERSION::$VERSION" | |
echo "Version $VERSION" | |
export RELEASE=true | |
echo "::set-env name=RELEASE::$RELEASE" | |
bash ./scripts/build_image.sh Dockerfile sgxwallet | |
bash ./scripts/publish_image.sh sgxwallet | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- name: Create Release | |
if: contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: ${{ env.VERSION }} | |
draft: false | |
prerelease: true | |