Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow that creates a docker container of Rayleigh #385

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: github-docker

on:
push:
branches:
- 'master'
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-bionic
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-bionic
cache-to: type=inline
push: true
tags: geodynamics/rayleigh:${{github.ref_name}}