Use upon
instead of handlebars
#24
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 | |
on: [push, pull_request] | |
jobs: | |
tool: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Rust | |
run: | | |
rustup set profile minimal | |
rustup toolchain install stable | |
rustup override set stable | |
- name: Build | |
run: cargo build --release | |
- uses: actions/cache@v2 | |
id: cache-tool | |
with: | |
path: target/release/sheldon-cross | |
key: ${{ runner.os }}-${{ hashFiles('Cargo.*', '*.rs') }} | |
build: | |
needs: tool | |
strategy: | |
matrix: | |
include: | |
- { target: "x86_64-unknown-linux-gnu", install_openssl_args: "linux-x86_64"} | |
- { target: "x86_64-unknown-linux-musl", install_openssl_args: "linux-x86_64 x86_64-linux-musl-"} | |
- { target: "armv7-unknown-linux-gnueabihf", install_openssl_args: "linux-armv4 arm-linux-gnueabihf-"} | |
- { target: "armv7-unknown-linux-musleabihf", install_openssl_args: "linux-armv4 arm-linux-musleabihf-"} | |
- { target: "aarch64-unknown-linux-gnu", install_openssl_args: "linux-aarch64 aarch64-linux-gnu-"} | |
- { target: "aarch64-unknown-linux-musl", install_openssl_args: "linux-aarch64 aarch64-linux-musl-"} | |
name: build (${{ matrix.target}}) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
id: cache-tool | |
with: | |
path: target/release/sheldon-cross | |
key: ${{ runner.os }}-${{ hashFiles('Cargo.*', '*.rs') }} | |
- name: Render Dockerfile | |
run: | | |
./target/release/sheldon-cross \ | |
--target "${{ matrix.target }}" \ | |
--install-openssl-args "${{ matrix.install_openssl_args }}" | |
- name: Build | |
run: | | |
docker build \ | |
--tag "${{ github.sha }}" \ | |
--file "docker/Dockerfile.${{ matrix.target }}" \ | |
docker | |
- name: Push | |
if: startsWith(github.event.ref, 'refs/tags') | |
run: | | |
docker login --username rossmacarthur --password "${{ secrets.DOCKER_TOKEN }}" | |
tag="rossmacarthur/sheldon-cross:${{ matrix.target }}-${GITHUB_REF#refs/tags/}" | |
docker tag "${{ github.sha }}" "$tag" | |
docker push "$tag" |