Skip to content

Merge pull request #21 from Th0masL/master #7

Merge pull request #21 from Th0masL/master

Merge pull request #21 from Th0masL/master #7

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Show informations about this GitHub Event
run: echo "$GIT_JSON_DATA"
env:
GIT_JSON_DATA: ${{ toJson(github) }}
- name: "[TAG] Detect Variables"
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
run: |
echo COMMIT_SHA_SHORT="$( echo ${{ github.sha }} | cut -c1-7 )" >> $GITHUB_ENV
echo DOCKER_IMAGE_TAG="$( echo ${{ github.event.ref }} | sed -e 's|^refs/tags/||g' | grep -E '^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$' )" >> $GITHUB_ENV
- name: "[OTHER] Detect Variables"
if: ${{ github.event_name != 'push' || github.ref_type != 'tag' }}
run: |
echo COMMIT_SHA_SHORT="$( echo ${{ github.sha }} | cut -c1-7 )" >> $GITHUB_ENV
echo DOCKER_IMAGE_TAG="$( echo ${{ github.sha }} | cut -c1-7 )" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and Push the Docker image
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USER }}/wine-x11-novnc-docker:${{ env.COMMIT_SHA_SHORT }}
${{ secrets.DOCKER_HUB_USER }}/wine-x11-novnc-docker:${{ env.DOCKER_IMAGE_TAG }}