wgwrsasddfsa #104
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Deploy to HBI | |
on: | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build Image" | |
runs-on: [self-hosted, linux] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Inject config | |
run: echo "$APPSETTINGS_CONTENT" > JournalyApiV2/appsettings.json | |
env: | |
APPSETTINGS_CONTENT: ${{ secrets.APPSETTINGS }} | |
- uses: docker/setup-buildx-action@v2 | |
- run: docker login -u "${{ secrets.REGISTRY_USERNAME }}" -p "${{ secrets.REGISTRY_PASSWORD }}" ${{ secrets.REGISTRY_ADDRESS }} | |
- uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./JournalyApiV2/Dockerfile | |
platforms: linux/amd64 | |
push: false | |
load: true | |
tags: ${{ secrets.REGISTRY_ADDRESS }}/journalyapi:latest | |
- run: | | |
mkdir -p $HOME/docker-image | |
docker save -o $HOME/docker-image/image.tar ${{ secrets.REGISTRY_ADDRESS }}/journalyapi:latest | |
push: | |
name: "Push Image" | |
needs: [build] | |
runs-on: [self-hosted, linux] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Load Docker image | |
run: docker load -i $HOME/docker-image/image.tar | |
- name: Login to HBI Container Registry | |
run: docker login -u "${{ secrets.REGISTRY_USERNAME }}" -p "${{ secrets.REGISTRY_PASSWORD }}" ${{ secrets.REGISTRY_ADDRESS }} | |
- name: Push | |
run: docker push ${{ secrets.REGISTRY_ADDRESS }}/journalyapi:latest | |
- name: Deploy to HBI Server | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: ${{ secrets.WEBHOOK }} | |
method: 'POST' |