Update Dockerfile #30
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 CI py-rocket-geospatial | |
env: | |
IMAGE_NAME: py-rocket-geospatial | |
IMAGE_TAG: 2024.07.11 | |
on: | |
workflow_dispatch: null | |
workflow_run: | |
workflows: ['Docker Image CI py-rocket-base'] | |
types: [completed] | |
push: | |
branches: main | |
paths: | |
- 'images/py-rocket-geospatial/**' | |
- '.github/workflows/docker-image-py-rocket-geospatial.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login to GitHub Container Registry | |
if: github.repository == 'nmfs-opensci/container-images' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build the Docker image | |
if: github.repository == 'nmfs-opensci/container-images' | |
run: | | |
docker build images/$IMAGE_NAME -f images/$IMAGE_NAME/Dockerfile --tag ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:$IMAGE_TAG --tag ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:latest | |
- name: Publish | |
if: github.repository == 'nmfs-opensci/container-images' | |
run: | | |
docker push ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:$IMAGE_TAG | |
docker push ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:latest |