Skip to content

slashs matter

slashs matter #31

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_hello-world:
defaults:
run:
working-directory: rust/hello-world
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Lint
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
- name: Test
run: |
cargo check
cargo test --all
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: aarch64-unknown-linux-gnu
args: "--locked --release"
strip: true
working-directory: ./rust/hello-world
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hello-world
path: |
rust/hello-world/target/aarch64-unknown-linux-gnu/release/hello-world
- name: Log into ghcr.io
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/babdor/curly-meme
- name: Get binary
uses: actions/download-artifact@v3
with:
name: hello-world
path: ./
- name: Build and push to ghcr
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/babdor/curly-meme:latest
labels: ${{ steps.meta.outputs.labels }}