updated README #2
This file contains hidden or 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
| on: | |
| push: | |
| branches: [main, master] | |
| paths: | |
| - Dockerfile | |
| - .github/workflows/docker-image.yaml | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Extra tag to push alongside latest/<sha> (e.g. 1.0.2) | |
| required: false | |
| default: "" | |
| name: docker-image.yaml | |
| permissions: read-all | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: docker-image-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| IMAGE: lperlaza/shinycellmodular | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Compute tags | |
| id: tags | |
| run: | | |
| PKG_VERSION=$(grep '^Version:' DESCRIPTION | head -1 | sed 's/^Version:[[:space:]]*//') | |
| TAGS="$IMAGE:latest"$'\n'"$IMAGE:$GITHUB_SHA"$'\n'"$IMAGE:$PKG_VERSION" | |
| if [ -n "${{ github.event.inputs.tag }}" ]; then | |
| TAGS="$TAGS"$'\n'"$IMAGE:${{ github.event.inputs.tag }}" | |
| fi | |
| { | |
| echo "tags<<EOF" | |
| echo "$TAGS" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.tags.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |