build(deps): bump Microsoft.Extensions.Configuration.Binder from 9.0.0 to 9.0.2 #633
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
push: | |
pull_request: | |
permissions: | |
packages: write | |
jobs: | |
ci-build-test: | |
runs-on: ubuntu-latest | |
container: joshkeegan/dotnet-build:9.0.100 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: make publish-all | |
- name: Run Unit Tests | |
working-directory: test/UnitTests | |
run: make run | |
- name: Upload Artefacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ci-build-test-artefacts | |
path: | | |
artefacts | |
sharedScripts | |
src/StringSearch.Api.Host/Dockerfile | |
src/StringSearch.Api.Host/out | |
Makefile | |
if: ${{ always() }} | |
ci-docker: | |
runs-on: ubuntu-latest | |
needs: ci-build-test | |
outputs: | |
uniqueifier: ${{ steps.output_uniqueifier.outputs.uniqueifier }} | |
steps: | |
- name: Docker Login | |
if: github.ref == 'refs/heads/master' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download Artefacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ci-build-test-artefacts | |
path: . | |
- name: Build Image | |
run: | | |
make \ | |
build-api-image \ | |
buildId="${{ github.run_number }}-${{ github.run_attempt }}" \ | |
commitHash="${GITHUB_SHA:0:8}" | |
- name: Publish Image | |
if: github.ref == 'refs/heads/master' | |
run: make publish-api-image | |
- name: Output Uniqueifier | |
id: output_uniqueifier | |
run: echo "uniqueifier=`cat artefacts/uniqueifier`" >> $GITHUB_OUTPUT | |
- name: Upload Artefacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ci-docker-artefacts | |
path: | | |
artefacts/deploy | |
artefacts/uniqueifier | |
sharedScripts | |
deploy-prod: | |
environment: prod | |
concurrency: deploy-prod | |
runs-on: ubuntu-latest | |
needs: ci-docker | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Download Artefacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ci-docker-artefacts | |
path: . | |
- name: Add SSH Private Key | |
run: | | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
echo -e "Host *\n\tStrictHostKeyChecking accept-new\n" > ~/.ssh/config | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
- name: Copy Artefacts to Target | |
run: | | |
set -x | |
ssh ${{ secrets.USERNAME }}@${{ secrets.HOSTNAME }} -p ${{ secrets.SSH_PORT }} "mkdir -p ~/cd/prod/gh-actions/${{ needs.ci-docker.outputs.uniqueifier }}" | |
for l in `ls`; \ | |
do \ | |
scp -r -P ${{ secrets.SSH_PORT }} $PWD/$l ${{ secrets.USERNAME }}@${{ secrets.HOSTNAME }}:~/cd/prod/gh-actions/${{ needs.ci-docker.outputs.uniqueifier }} ; \ | |
done | |
- name: Deploy | |
run: | | |
ssh ${{ secrets.USERNAME }}@${{ secrets.HOSTNAME }} -p ${{ secrets.SSH_PORT }} \ | |
"cd ~/cd/prod/gh-actions/${{ needs.ci-docker.outputs.uniqueifier }}/artefacts/deploy && \ | |
make \ | |
rootPath=\"/home/josh/pisearch/pi_digits\" \ | |
environment=\"prod\" \ | |
appsettingsDir=\"/home/josh/pisearch/config\" \ | |
hostname=\"${{ secrets.HOSTNAME }}\" \ | |
deploy" | |
- name: Post-Deployment Tests | |
run: /bin/bash artefacts/deploy/runDeploymentTests.sh ${{ secrets.HOSTNAME }} 80 | |