Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Merge branch 'main' of github.com:crust-hub/tubekit into main #126

Merge branch 'main' of github.com:crust-hub/tubekit into main

Merge branch 'main' of github.com:crust-hub/tubekit into main #126

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/tubekit
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: create tag
run: |
SHA=${{ github.sha }}
TAG=${IMAGE}:$(TZ=UTC-9 date '+%Y%m')-${SHA:0:7}
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
TAG="${IMAGE}:latest"
fi
echo "TAG=$TAG" >> $GITHUB_ENV
echo TAG $TAG
- name: login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build docker image
run: |
docker build . -t ${{ env.TAG }}
- name: push image
run: |
docker push ${{ env.TAG }}