Skip to content

Commit

Permalink
Add Github Actions for Version Tag Docker Build
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAxelander committed Mar 14, 2024
1 parent 1e7f079 commit 801a204
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docker-image-version-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Docker Image (Version Tag)

on:
push:
tags:
- "*"

env:
DOTNET_VERSION: '8.0.100' # The .NET SDK version to use

jobs:
test:
runs-on: ubuntu-latest
name: Run Test Cases
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Blazor dependencies
run: dotnet restore OpenBudgeteer.Blazor

- name: Build Blazor
run: dotnet build OpenBudgeteer.Blazor --configuration Release --no-restore

- name: Run Core Test Cases
run: dotnet test OpenBudgeteer.Core.Test
deploy-docker:
runs-on: ubuntu-latest
name: Build and Push Docker Image
needs: test
if: success()
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: axelander/openbudgeteer:${{ github.ref_name }}"
platforms: linux/arm64,linux/amd64

0 comments on commit 801a204

Please sign in to comment.