upgrade to 17.4.1 #41
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
name: Docker image automatic build (ghcr) | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- master | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set tag for testing | |
run: | | |
echo "TAG=$(date +%s)" >> $GITHUB_ENV | |
- name: Build the Docker image (for testing) | |
run: | | |
docker build . --file Dockerfile --tag ${{ env.IMAGE_NAME }}:$TAG | |
- name: Testdrive | |
run: | | |
TAG=$TAG ./testdrive.sh | |
env: | |
IMAGE_NAME: ${{ env.IMAGE_NAME }} | |
- name: Login to ghcr | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
if: github.ref == 'refs/heads/master' | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
if: github.ref == 'refs/heads/master' | |
id: meta | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Get tag from .gitlab-version | |
if: github.ref == 'refs/heads/master' | |
id: tag | |
run: echo "tag=$(cat .gitlab-version)" >> $GITHUB_OUTPUT | |
- name: Build and push | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
if: github.ref == 'refs/heads/master' | |
with: | |
context: . | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} | |
labels: ${{ steps.meta.outputs.labels }} |