chore: update workflows
This commit is contained in:
@@ -5,16 +5,16 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.github/**'
|
- ".github/**"
|
||||||
- '.vscode/**'
|
- ".vscode/**"
|
||||||
- '.gitignore'
|
- ".gitignore"
|
||||||
- '.editorconfig'
|
- ".editorconfig"
|
||||||
- 'LICENSE.md'
|
- "LICENSE.md"
|
||||||
- 'docker-compose.dev.yml'
|
- "docker-compose.dev.yml"
|
||||||
- 'docker-compose.prod.yml'
|
- "docker-compose.prod.yml"
|
||||||
- '**/*/README.md'
|
- "**/*/README.md"
|
||||||
- '**/*/Dockerfile'
|
- "**/*/Dockerfile"
|
||||||
- 'scripts/**'
|
- "scripts/**"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and push Docker image
|
name: Build and push Docker image
|
||||||
@@ -23,30 +23,35 @@ jobs:
|
|||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Create version tag
|
- name: Create version tag
|
||||||
id: version
|
id: version
|
||||||
run: echo "version=$(date +%Y.%m.%d.%H%M%S)" >> $GITHUB_OUTPUT
|
run: echo "version=$(date +%Y.%m.%d.%H%M%S)" >> $GITHUB_OUTPUT
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
- name: Build and push server image
|
- name: Build and push server image
|
||||||
working-directory: src/Blog
|
uses: docker/build-push-action@v7
|
||||||
run: |
|
with:
|
||||||
TAG=${{ secrets.DOCKERHUB_USERNAME }}/blog.stevanfreeborn.com:${{ steps.version.outputs.version }}
|
context: src/Blog
|
||||||
docker build -t $TAG .
|
platforms: linux/arm64
|
||||||
docker push $TAG
|
push: true
|
||||||
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/blog.stevanfreeborn.com:${{ steps.version.outputs.version }}
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to server
|
name: Deploy to server
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Copy files to server
|
- name: Copy files to server
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v7
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v5
|
||||||
with:
|
with:
|
||||||
dotnet-version: 9.0.x
|
dotnet-version: 10.0.x
|
||||||
- name: Install report generator
|
- name: Install report generator
|
||||||
run: dotnet tool install --global dotnet-reportgenerator-globaltool
|
run: dotnet tool install --global dotnet-reportgenerator-globaltool
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
@@ -40,13 +40,13 @@ jobs:
|
|||||||
- name: Test project
|
- name: Test project
|
||||||
run: dotnet test -e DOTNET_ENVIRONMENT=CI --no-build --verbosity normal -s ./test/Blog.Tests/ci.runsettings
|
run: dotnet test -e DOTNET_ENVIRONMENT=CI --no-build --verbosity normal -s ./test/Blog.Tests/ci.runsettings
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: test-results
|
name: test-results
|
||||||
path: ./test/Blog.Tests/TestResults
|
path: ./test/Blog.Tests/TestResults
|
||||||
- name: Upload playwright traces
|
- name: Upload playwright traces
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: playwright-traces
|
name: playwright-traces
|
||||||
path: ./test/Blog.Tests/bin/Debug/net10.0/playwright-traces
|
path: ./test/Blog.Tests/bin/Debug/net10.0/playwright-traces
|
||||||
|
|||||||
Reference in New Issue
Block a user