Skip to content

Update installation.md #59

Update installation.md

Update installation.md #59

Workflow file for this run

name: Build
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
env:
AWS_DEFAULT_REGION: ap-southeast-2
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'nogha') && !contains(github.event.head_commit.message, 'nobuild')"
strategy:
matrix:
os: ["ubuntu-20.04"]
steps:
- uses: actions/checkout@v3
- name: Init runner
run: .github/workflows/scripts/runner-init.sh
- name: Cache build image
uses: actions/cache@v3
continue-on-error: false
with:
path: image-build.tgz
key: ansilo-build-${{ runner.os }}-${{ hashFiles('.github/workflows/docker/build.ubi9.Dockerfile', '.github/workflows/scripts/build-build-image.sh') }}
- name: Cache maven registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.m2
key: ansilo-release-package-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: Build base image
run: .github/workflows/scripts/build-build-image.sh
- uses: Swatinem/rust-cache@v2
- name: Create volume dirs
run: .github/workflows/scripts/volumes.sh
- name: Cargo build
run: |
docker run \
-v $HOME/.cargo:/home/build/.cargo \
-v $HOME/.m2:/home/build/.m2 \
-v $PWD:/build/ \
-w /build/ \
ansilo-build /build/.github/workflows/scripts/release-build.sh
- name: Build release image
run: |
docker build -t ansilo-release \
--file .github/workflows/docker/release.ubi9.Dockerfile .
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-2
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v1
- name: Push to Amazon ECR
env:
REGISTRY: 635198228996.dkr.ecr.ap-southeast-2.amazonaws.com
REPOSITORY: ansilo-dev
IMAGE_TAG: ${{ github.head_ref || github.ref_name }}
run: |
docker tag ansilo-release $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG