[tag] v0.2.45-2 #224
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 | |
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 | |