build(hello-tracing-gateway): release version 1.0.2 #8
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-hello-tracing-gateway | |
on: | |
push: | |
tags: | |
- hello-tracing-gateway-v* | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: | | |
toolchain=$(grep channel rust-toolchain.toml | sed -r 's/channel = "(.*)"/\1/') | |
echo "installing toolchain $toolchain from rust-toolchain.toml" | |
rm /home/runner/.cargo/bin/rustfmt | |
rustup toolchain install $toolchain --profile minimal | |
rustup component add --toolchain $toolchain rustfmt | |
rustup component add --toolchain $toolchain clippy | |
- name: Install just | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: just | |
- name: Build | |
run: just check | |
- name: Check code format | |
run: just fmt-check | |
- name: Run linter | |
run: just lint | |
- name: Run tests | |
run: just test | |
- name: Determine version | |
id: version | |
run: | | |
ref_name=${{ github.ref_name }} | |
version=${ref_name#hello-tracing-gateway-} | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Docker metadata | |
uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: hseeberger/hello-tracing-gateway | |
tags: type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker build and push hello-tracing-gateway | |
uses: docker/build-push-action@v5 | |
with: | |
file: hello-tracing-gateway/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true |