Skip to content

bump

bump #19

Workflow file for this run

name: preview
on:
workflow_dispatch:
push:
branches:
- ci-preview
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.80.0
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
jobs:
build:
name: Build
runs-on: ubuntu-latest-4-cores
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "25.x"
- name: Build binaries
run: |
cargo build -r --bin katana
cargo build -r --bin torii
cargo build -r --bin sozo
- name: Move Binaries
run: |
mkdir -p artifacts/linux/amd64/
mv target/release/katana artifacts/linux/amd64/
mv target/release/torii artifacts/linux/amd64/
mv target/release/sozo artifacts/linux/amd64/
shell: bash
# Upload these for use with the Docker build later
- name: Upload docker binaries
uses: actions/upload-artifact@v3
with:
name: binaries
path: artifacts
retention-days: 1
docker-build-and-push:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: binaries
path: artifacts
- name: TEMP LS
run: ls -R artifacts
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set outputs
id: vars
run: |
git config --global --add safe.directory '*'
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build and push docker image
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/${{ github.repository }}:preview--${{ steps.vars.outputs.sha_short }}
platforms: linux/amd64
build-contexts: |
artifacts=artifacts