From 567dfcfb4e5cc113d45fbe28e7d35f8c8d2a1fca Mon Sep 17 00:00:00 2001 From: Daniel Olano Date: Fri, 1 Mar 2024 21:42:36 +0100 Subject: [PATCH] Change build action to release container --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ .github/workflows/rust.yml | 22 ---------------------- justfile | 3 +++ 3 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0f0f07b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release container + +on: + push: + tags: [ "*" ] + +jobs: + build: + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - name: Build container + run: just build-container + + publish: + runs-on: self-hosted + name: Publish container + needs: build + steps: + - name: Login to registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Publish image + run: | + podman push ghcr.io/virto-network/virto-proxy:$(just version) + podman push ghcr.io/virto-network/virto-proxy:latest diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 31000a2..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Rust - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose diff --git a/justfile b/justfile index eabe10b..15d9aac 100644 --- a/justfile +++ b/justfile @@ -5,6 +5,9 @@ image := "ghcr.io/virto-network/virto-proxy" @default: just --list +@version: + echo {{ ver }} + build-container: #!/usr/bin/env nu 'FROM rust:1.75 as builder