Skip to content

Commit

Permalink
docker build & push
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Dec 14, 2023
1 parent c4b5906 commit 2d380d6
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
tfsec:
name: Run TFsec
Expand Down Expand Up @@ -39,6 +43,47 @@ jobs:
recursive: "true"
recursive-path: "modules"
git-push: "true"
build-tests:
name: Build tests
runs-on: ubuntu-latest
needs: docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup MinVer
run: |
dotnet tool install --global minver-cli --version 4.2.0
- name: Calculate Version
run: |
echo "MINVERVERSIONOVERRIDE=$($HOME/.dotnet/tools/minver -t v. -m 1.0 -d preview)" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Lower case REPO
run: |
echo "GITHUB_REPOSITORY_LOWER_CASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./tests/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/agwpepcustomnames:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta.outputs.labels }}
artifacts:
name: Create artifacts
runs-on: ubuntu-latest
Expand Down

0 comments on commit 2d380d6

Please sign in to comment.