Skip to content

Commit

Permalink
Merge pull request #64 from shield-auth/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
CA-MKSingh authored Oct 6, 2024
2 parents 99edc57 + 9bb74e0 commit f4fa2dc
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 16 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
name: Rust
name: Rust CI/CD

on:
push:
branches: [ "trunk" ]
pull_request:
branches: [ "trunk" ]
branches: ["trunk"]

env:
CARGO_TERM_COLOR: always
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
IMAGE_NAME: "shieldauth/shield"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3

- name: Check CircleCI Status
uses: actions/github-script@v6
with:
script: |
const circleciCheck = await github.checks.listForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.sha,
});
const circleciCheckStatus = circleciCheck.data.check_runs.find(run => run.app.name === 'CircleCI');
if (!circleciCheckStatus || circleciCheckStatus.conclusion !== 'success') {
throw new Error('CircleCI checks did not pass.');
}
- name: Build the project
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

- name: Log in to DockerHub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin

- name: Build Docker image
run: docker build -t $IMAGE_NAME:${{ github.sha }} .

- name: Push Docker image to DockerHub
run: |
docker tag $IMAGE_NAME:${{ github.sha }} $IMAGE_NAME:latest
docker push $IMAGE_NAME:${{ github.sha }}
docker push $IMAGE_NAME:latest
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/shield_auth">
</a>
</p>
<p align="center">
<a href="https://dl.circleci.com/status-badge/redirect/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/trunk">
<img src="https://img.shields.io/circleci/build/gh/shield-auth/shield/trunk?label=CircleCi:+trunk" alt="CircleCI">
</a>
<a href="https://dl.circleci.com/status-badge/redirect/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/develop">
<img src="https://img.shields.io/circleci/build/gh/shield-auth/shield/develop?label=CircleCi:+develop" alt="CircleCI">
<p align="center" style="display: flex; gap: 10px; width: 100%; justify-content: center;">
<a href="https://dl.circleci.com/status-badge/redirect/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/trunk" target="_blank" style="display: inline-flex; gap: 0px;">
<img src="https://img.shields.io/badge/CircleCi:_trunk-gray"alt="CircleCI" style="border-radius-right: 0px;">
<img src="https://dl.circleci.com/status-badge/img/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/trunk.svg?style=svg" alt="CircleCI">
</a>
<a href="https://dl.circleci.com/status-badge/redirect/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/develop" target="_blank" style="display: inline-flex; gap: 0px;">
<img src="https://img.shields.io/badge/CircleCi:_develop-gray"alt="CircleCI" style="border-radius-right: 0px;">
<img src="https://dl.circleci.com/status-badge/img/circleci/PKLAPqiFRA5ffRQTi5dtfY/HvBHutnD43T9HBYcqAWgD4/tree/develop.svg?style=svg" alt="CircleCI" style="border-radius-left: 0px;">
</a>
</p>
<!-- markdownlint-restore -->
Expand Down

0 comments on commit f4fa2dc

Please sign in to comment.