Merge pull request #465 from gassmoeller/fix_docker_image_for_apptainer #55
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: github-docker | |
on: | |
push: | |
branches: | |
- 'main' | |
release: | |
types: [created] | |
concurrency: | |
group: docker-build | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
if: github.repository == 'geodynamics/rayleigh' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_LOGIN }} | |
- name: Build and push Docker image for master | |
if: contains(github.event_name, 'push') | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./docker/rayleigh/ | |
cache-from: type=registry,ref=geodynamics/rayleigh-buildenv-jammy | |
cache-to: type=inline | |
push: true | |
tags: geodynamics/rayleigh:latest | |
- name: Build and push Docker image for release | |
if: contains(github.event_name, 'release') | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./docker/rayleigh/ | |
cache-from: type=registry,ref=geodynamics/rayleigh-buildenv-jammy | |
cache-to: type=inline | |
push: true | |
tags: geodynamics/rayleigh:${{github.ref_name}} | |