Updated NuGets only. #61
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
# Contributed by Goetz Goerisch, VDW - Verein Deutscher Werkzeugmaschinenfabriken e.V. | |
name: Docker Build | |
on: [push, pull_request] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
env: | |
# Check if this is not a pull request and GITHUB_TOKEN is set | |
# As all env variables are strings, you need to compaire against "== 'true'" (not "== true") | |
IS_NOT_PR: ${{ !github.head_ref && true }} | |
steps: | |
- name: Checkout Sample-Server | |
uses: actions/checkout@v2 | |
with: | |
path: Sample-Server | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: PrepareReg Names | |
run: | | |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV | |
echo IMAGE_TAG=$(echo ${{ github.ref }} | tr '[:upper:]' '[:lower:]' | awk '{sub(/([^\/]*\/){2}/,""); gsub(/\/|_/, "-")}1') >> $GITHUB_ENV | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
if: env.IS_NOT_PR == 'true' | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker Release | |
uses: "docker/build-push-action@v2" | |
with: | |
file: "./Dockerfile" | |
platforms: linux/amd64 | |
push: ${{env.IS_NOT_PR == 'true'}} | |
tags: | | |
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }} |