Merge pull request #106 from naik-aakash/add_devcontainer #2
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: Build and Push Docker Image | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.10", "3.11", "3.12" ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Build Docker image with a custom Python version | |
- name: Build Docker image (Python ${{ matrix.python-version }}) | |
run: | | |
docker build \ | |
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \ | |
-t ghcr.io/jageo/autoplex:python-${{ matrix.python-version }} . | |
- | |
# Push Docker image to GHCR | |
- name: Push Docker image to GHCR (Python ${{ matrix.python-version }}) | |
run: | | |
docker push ghcr.io/jageo/autoplex:python-${{ matrix.python-version }} |