Skip to content

Commit

Permalink
chore: create caller actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Amninder Kaur committed Aug 11, 2023
1 parent 503f1e3 commit e947b8b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
31 changes: 2 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/workflows/rust_build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e947b8b

Please sign in to comment.