Integrate azure blob storage, update root namespace #48
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: .NET | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
environment: build-test | |
env: | |
MinioOptions__AccessKey: ${{ secrets.MINIOOPTIONS__ACCESSKEY }} | |
MinioOptions__SecretKey: ${{ secrets.MINIOOPTIONS__SECRETKEY }} | |
MinioOptions__Url: ${{ secrets.MINIOOPTIONS__URL }} | |
ShortenerOptions__APIHOST: ${{ secrets.SHORTENEROPTIONS__APIHOST }} | |
ShortenerOptions__ApiKey: ${{ secrets.SHORTENEROPTIONS__APIKEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore ./server/ | |
- name: Build | |
run: dotnet build --no-restore ./server/ | |
- name: Test | |
run: dotnet test --no-build --verbosity normal ./server/ | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: net-build | |
path: ./ | |
push-to-dockerhub: | |
needs: build-test | |
environment: build-test | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: net-build | |
path: . | |
- name: Build Docker Image | |
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/imagizer . | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push Image to Docker Hub | |
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/imagizer |