Reuse time metadata config in XIOS (#939) #245
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: Periodic Docker build | |
on: | |
# Build the Docker container upon merging into main or develop | |
push: | |
branches: [ main, develop ] | |
# Build the Docker container whenever commits are pushed to an open PR that changes one of the files listed | |
pull_request: | |
paths: | |
- .github/workflows/docker.yml | |
- Dockerfiles/Dockerfile.devenv | |
- Dockerfiles/install-xios.sh | |
- Dockerfiles/spack.yaml | |
# Build the Docker container at 00:00 on the first day of every 3 months | |
schedule: | |
- cron: '0 0 1 */3 *' | |
jobs: | |
docker: | |
name: Build Docker container | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v4 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into GitHub Container Repository | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
logout: true | |
- name: Build container | |
uses: docker/build-push-action@v5 | |
if: github.event_name == 'pull_request' | |
with: | |
push: false | |
file: Dockerfiles/Dockerfile.devenv | |
tags: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
- name: Build container and push to ghcr | |
uses: docker/build-push-action@v5 | |
if: github.event_name == 'push' || github.event_name == 'schedule' | |
with: | |
push: true | |
file: Dockerfiles/Dockerfile.devenv | |
tags: ghcr.io/nextsimhub/nextsimdg-dev-env:latest |