diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..fb387ca --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,27 @@ +name: docker-tagged + +on: + push: + tags: + - '**' + branches-ignore: + - 'main' + +jobs: + docker: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERUSER }} + password: ${{ secrets.DOCKERPASSWORD }} + registry: ${{ secrets.DOCKERREGISTRY }} + - name: Restore dependencies + run: dotnet restore + - name: Publish Website + run: dotnet publish Website/Website.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerRegistry=${{ secrets.DOCKERREGISTRY }} -p:ContainerRepository=mecatol_archives_website -p:ContainerImageTags=${{ github.ref_name }} + - name: Publish API + run: dotnet publish API/API.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerRegistry=${{ secrets.DOCKERREGISTRY }} -p:ContainerRepository=mecatol_archives_api -p:ContainerImageTags=${{ github.ref_name }} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index acbec22..193cbe9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: ci +name: docker-latest on: push: @@ -6,7 +6,7 @@ on: - 'main' jobs: - docker: + docker-latest: runs-on: windows-latest steps: - name: Checkout @@ -20,6 +20,6 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Publish Website - run: dotnet publish Website/Website.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerRegistry=${{ secrets.DOCKERREGISTRY }} -p:ContainerRepository=mecatol_archives_website + run: dotnet publish Website/Website.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerRegistry=${{ secrets.DOCKERREGISTRY }} -p:ContainerRepository=mecatol_archives_website -p:ContainerImageTag=latest - name: Publish API - run: dotnet publish API/API.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerRegistry=${{ secrets.DOCKERREGISTRY }} -p:ContainerRepository=mecatol_archives_api \ No newline at end of file + run: dotnet publish API/API.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerRegistry=${{ secrets.DOCKERREGISTRY }} -p:ContainerRepository=mecatol_archives_api -p:ContainerImageTag=latest \ No newline at end of file