Skip to content

Merge pull request #52 from marcelthole/normalize-more-fields #14

Merge pull request #52 from marcelthole/normalize-more-fields

Merge pull request #52 from marcelthole/normalize-more-fields #14

Workflow file for this run

# From:
# https://www.docker.com/blog/docker-github-actions/
# https://github.com/metcalfc/docker-action-examples
name: Docker-Build
on:
push:
tags:
- "*.*"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test Dockerfile
uses: ./.github/actions/validate-dockerfile
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Build and push
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./docker
file: ./docker/Dockerfile
build-args: |
COMPOSER_REQUIRE_VERSION=${{ steps.get_version.outputs.VERSION }}
push: true
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.VERSION }}