Publish image testing.
This commit is contained in:
@@ -6,6 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-test:
|
build-test:
|
||||||
|
if: ${{ false }} # disabled for now
|
||||||
runs-on: [self-hosted, linux, x64, docker]
|
runs-on: [self-hosted, linux, x64, docker]
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/catthehacker/ubuntu:act-latest
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||||
@@ -26,4 +27,37 @@ jobs:
|
|||||||
|
|
||||||
- run: dotnet restore
|
- run: dotnet restore
|
||||||
- run: dotnet build --configuration Release --no-restore
|
- run: dotnet build --configuration Release --no-restore
|
||||||
- run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"
|
- run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"
|
||||||
|
|
||||||
|
publish-image:
|
||||||
|
runs-on: [self-hosted, linux, x64, docker]
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ secrets.REGISTRY_HOST }}
|
||||||
|
OWNER_REPO: ${{ github.repository }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Normalize image name (lowercase)
|
||||||
|
id: names
|
||||||
|
run: |
|
||||||
|
IMAGE_LC="$(echo "${REGISTRY}/${OWNER_REPO}" | tr '[:upper:]' '[:lower:]')"
|
||||||
|
echo "image=${IMAGE_LC}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Docker login
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" \
|
||||||
|
| docker login "${{ env.REGISTRY }}" \
|
||||||
|
-u "${{ secrets.REGISTRY_USER }}" \
|
||||||
|
--password-stdin
|
||||||
|
|
||||||
|
- name: Enable BuildKit
|
||||||
|
run: echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: docker build -t "${{ steps.names.outputs.image }}:${{ github.sha }}" .
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: |
|
||||||
|
docker push "${{ steps.names.outputs.image }}:${{ github.sha }}"
|
||||||
|
docker tag "${{ steps.names.outputs.image }}:${{ github.sha }}" "${{ steps.names.outputs.image }}:latest"
|
||||||
|
docker push "${{ steps.names.outputs.image }}:latest"
|
||||||
Reference in New Issue
Block a user