diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 310120a..e2c4506 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,35 +2,8 @@ name: build on: push: - branches: - - feature/* jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - run: rustup component add rustfmt clippy - - name: cargo build - run: cargo build - publish: - runs-on: ubuntu-latest - needs: build - if: needs.build.result == 'success' - steps: - - name: Checkout the repo - uses: actions/checkout@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.AMN_PAT }} - - - name: Build the chronos Docker image - run: | - docker build -f Dockerfile.chronos . --tag ghcr.io/kindredgroup/chronos:latest - docker push ghcr.io/kindredgroup/chronos:latest + uses: ./rust_build + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3b02b77 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: build + +on: + push: + branches: + - master + +jobs: + build: + uses: ./build + publish: + runs-on: ubuntu-latest + needs: build + if: needs.build.result == 'success' + steps: + - name: Checkout the repo + uses: actions/checkout@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.AMN_PAT }} + + - name: Build the chronos Docker image + run: | + docker build -f Dockerfile.chronos . --tag ghcr.io/kindredgroup/chronos:latest + docker push ghcr.io/kindredgroup/chronos:latest diff --git a/.github/workflows/rust_build.yml b/.github/workflows/rust_build.yml new file mode 100644 index 0000000..b9b8b49 --- /dev/null +++ b/.github/workflows/rust_build.yml @@ -0,0 +1,17 @@ +name: rust build + +on: + workflow_call + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - run: rustup component add rustfmt clippy + - name: cargo build + run: cargo build +