diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..e2ac5b3 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,25 @@ +name: Run Cargo Audit + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * *' + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run audit + uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..e1a7cc7 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,33 @@ +name: Publish Docker image to GitHub Package Registry + +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Copy Repo Files + uses: actions/checkout@master + + - name: Publish Docker Image to GPR + uses: machine-learning-apps/gpr-docker-publish@master + id: docker + with: + IMAGE_NAME: 'user-management-server' + DOCKERFILE_PATH: 'Dockerfile' + BUILD_CONTEXT: '.' + CACHE: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Show outputs of previous step + run: | + echo "The name:tag of the Docker Image is: $VAR1" + echo "The docker image is hosted at $VAR2" + env: + VAR1: ${{ steps.docker.outputs.IMAGE_SHA_NAME }} + VAR2: ${{ steps.docker.outputs.IMAGE_URL }} \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a5e6e8e..7fdcafb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Rust +name: Build and Test on: push: @@ -32,8 +32,3 @@ jobs: - name: Run tests run: cargo test --verbose - - - name: Run audit - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }}