ci: rename stage + remove unused env vars #2
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 tar.gz | |
on: | |
push: | |
branches: [ develop, '**release**', 'ci/update-build'] | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
build-tar: | |
runs-on: ubuntu-22.04 | |
env: | |
SGX_MODE: HW | |
VERSION: "1.0.3" | |
PRODUCTION_MODE: true | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Retrieve the secret and decode it to a file | |
env: | |
ENCLAVE_PK_BASE64: ${{ secrets.ENCLAVE_PK_BASE64 }} | |
run: | | |
rm sgxvm/Enclave_dev_private.pem || true | |
rm sgxvm/Enclave_private.pem || true | |
echo $ENCLAVE_PK_BASE64 | base64 --decode > sgxvm/Enclave_private.pem | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get version | |
id: get_version | |
uses: battila7/get-version-action@v2 | |
- name: Build .tar.gz Package Image | |
uses: docker/build-push-action@v4 | |
with: | |
file: ./docker/tar.Dockerfile | |
context: . | |
load: true | |
tags: tar_build | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
SGX_MODE=HW | |
ENCLAVE_HOME="/usr/lib/" | |
PRODUCTION_MODE=true | |
target: build-tar | |
- name: Run .tar.gz Package | |
run: | | |
docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/build:/build build-tar | |
cp build/swisstronik_${{ env.VERSION }}_amd64.tar.gz swisstronik_${{ env.VERSION }}_amd64.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: swisstronik_${{ env.VERSION }}_amd64.tar.gz | |
path: swisstronik_${{ env.VERSION }}_amd64.tar.gz |