new: add support for using environment variables in configuration #10
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: Build | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
PACKAGE_NAME: pixy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-binary: | |
strategy: | |
fail-fast: true | |
matrix: | |
architecture: | |
- target: "x86_64-unknown-linux-musl" | |
name: "amd64" | |
- target: "aarch64-unknown-linux-musl" | |
name: "arm64" | |
- target: "armv7-unknown-linux-musleabihf" | |
name: "armv7" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install cargo-deb | |
run: cargo install cargo-deb | |
- name: Install cross-rs | |
run: cargo install cross --git https://github.com/cross-rs/cross | |
- name: Lint the code | |
run: cargo clippy | |
- name: Run the security audit check | |
run: cargo audit | |
- name: Build the binary for the target | |
run: cross build --target ${{ matrix.architecture.target }} --release -p ${{ env.PACKAGE_NAME }} | |
- name: Build the deb package for the target | |
run: cargo deb --target ${{ matrix.architecture.target }} --no-build --no-strip -p ${{ env.PACKAGE_NAME }} | |
build-container: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build the container | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: false | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} |