From 8d80daeb1a54360135c3bb52a1519e7db4cb0790 Mon Sep 17 00:00:00 2001 From: Alex Hesketh Date: Wed, 21 Feb 2024 08:54:11 +0000 Subject: [PATCH] Add Workflows for other branches --- .github/workflows/docker.yml | 27 +++++++++++++++++++++++++++ .github/workflows/main.yml | 8 ++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docker.yml 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