Skip to content

gpanel

gpanel #2

Workflow file for this run

name: Publish Docker image
on:
push:
branches:
- master
release:
types: [published]
workflow_dispatch:
jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
- name: get_image_name
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
repository=${{ github.repository }}
IMAGE_NAME=${{ github.actor }}/${repository##*/}:$VERSION
echo IMAGE_NAME=$IMAGE_NAME
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.IMAGE_NAME }}
- name: Push gpanel to Docker Hub
run: |
docker build -f Dockerfile.gpanel -t ${{ env.IMAGE_NAME }}:gpanel .
docker push ${{ env.IMAGE_NAME }}:gpanel