build(ci): update released to published for docker image publishing #1
Workflow file for this run
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: Test AMD64 Docker image builds | |
on: | |
push: | |
pull_request: | |
types: [opened, reopened] | |
jobs: | |
docker-image: | |
name: Test Docker pynoel-gui-app build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove unnecessary files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Determine branch name (non-PR events) | |
if: github.event_name != 'pull_request' | |
shell: bash | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | |
- name: Determine branch name (PR events) | |
if: github.event_name == 'pull_request' | |
shell: bash | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: noelmni/pynoel-gui-app | |
tags: | | |
type=raw,value=${{ env.BRANCH_NAME }}-${{ github.sha }} | |
labels: | | |
org.opencontainers.image.title="noelTexturesPy" | |
org.opencontainers.image.description="Dash app to generate texture maps from MRI using Advanced Normalization Tools" | |
org.opencontainers.image.vendor="Neuroimaging of Epilepsy Laboratory at McGill University" | |
- name: Set up Python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Python build dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel build | |
- name: Build Python wheel and upload artifact | |
id: wheels | |
run: python -m build --wheel --outdir dist/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: dist/*.whl | |
- name: Build Docker image (test only) | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: false # ensure the image is not pushed to Docker Hub during testing | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |