Skip to content

hotfix RELEASE_NOTES #30

hotfix RELEASE_NOTES

hotfix RELEASE_NOTES #30

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Restore
run: dotnet restore src/Giraffe.Website/Giraffe.Website.fsproj
- name: Build
run: dotnet build --configuration Release --no-restore src/Giraffe.Website/Giraffe.Website.fsproj
deploy:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
env:
PROJECT: giraffefsharp
IMAGE: giraffe-website
steps:
# Checkout repo
- name: Checkout
uses: actions/checkout@v4
# Build the Docker image
- name: Build Docker image
run: |
PATTERN="refs/tags/v"
SUB=""
TAG="${GITHUB_REF/$PATTERN/$SUB}"
docker build --build-arg version=$TAG -t "$PROJECT"/"$IMAGE":"$TAG" -f src/Giraffe.Website/Dockerfile .
# Auth with Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
# Push the Docker image to Docker Hub
- name: Publish Docker image
run: |
PATTERN="refs/tags/v"
SUB=""
TAG="${GITHUB_REF/$PATTERN/$SUB}"
docker push $PROJECT/$IMAGE:$TAG