Made some optimizations #241
Workflow file for this run
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: Release App | |
on: | |
push: | |
tags: "*" | |
env: | |
IMAGE_NAME: myjettools/my-nosql-server | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF_NAME}) | |
- name: Updating version | |
run: sed -i -e 's/^version = .*/version = "${{ steps.get_version.outputs.VERSION }}"/' Cargo.toml | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- run: cargo build --release | |
- name: Docker login | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASS: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USER" --password-stdin | |
- name: Docker Build and Publish | |
run: | | |
ver=$(cat Cargo.toml | grep -m1 version | grep -Eo '["\047].*["\047]' | tr -d '"') | |
echo $ver | |
docker build -t ${IMAGE_NAME}:${{ steps.get_version.outputs.VERSION }} . | |
docker push ${IMAGE_NAME}:${{ steps.get_version.outputs.VERSION }} |