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