Build Docker Images #12
This file contains hidden or 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 Docker Images | |
| on: | |
| schedule: | |
| - cron: "0 4 1 * *" | |
| workflow_dispatch: | |
| jobs: | |
| build_gromacs_and_core: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'NMRLipids/FAIRMD_lipids' | |
| steps: | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Get latest gromacs release version | |
| id: version | |
| run: | | |
| set -euo pipefail | |
| tag="$(curl -fsSL "https://gitlab.com/api/v4/projects/gromacs%2Fgromacs/releases/permalink/latest" | jq -r .tag_name)" | |
| echo "version=${tag#v}" >> "$GITHUB_OUTPUT" | |
| echo "Latest tag: $tag" | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Build gromacs image | |
| run: | | |
| docker build \ | |
| -f developer/docker/gromacs \ | |
| -t nmrlipids/gromacs \ | |
| --build-arg GROMACS_VERSION=${{ steps.version.outputs.version }} \ | |
| . | |
| - name: Push gromacs image | |
| run: | | |
| docker push nmrlipids/gromacs | |
| - name: Build core image | |
| run: | | |
| docker build -f developer/docker/core -t nmrlipids/core . | |
| - name: Push core image | |
| run: docker push nmrlipids/core | |