Skip to content

Docker image

Docker image #227

Workflow file for this run

name: Docker image
on:
push:
workflow_dispatch:
repository_dispatch:
jobs:
docker-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- run: docker build -f Dockerfile -t subdirectory/subshell:${{ github.sha }} .
name: docker build
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: docker push subdirectory/subshell:${{ github.sha }}
name: docker push dockerhub sha
- run: |
docker tag subdirectory/subshell:${{ github.sha }} subdirectory/subshell
docker push subdirectory/subshell
if: github.ref == 'refs/heads/main'
name: docker push dockerhub latest
# get git tag
# https://github.com/orgs/community/discussions/26686
- run: |
docker tag subdirectory/subshell:${{ github.sha }} subdirectory/subshell:${{ github.ref_name }}
docker push subdirectory/subshell:${{ github.ref_name }}
name: docker push dockerhub tag