Skip to content

Build bespoke PyGEM Docker container #64

Build bespoke PyGEM Docker container

Build bespoke PyGEM Docker container #64

Workflow file for this run

name: 'Build bespoke PyGEM Docker container'
on:
# Trigger when these files change in an open PR
pull_request:
paths:
- '.github/workflows/docker_pygem.yml'
- 'docker/Dockerfile'
# Trigger when these files change on the master or dev branches
push:
branches:
- master
- dev
paths:
- '.github/workflows/docker_pygem.yml'
- 'docker/Dockerfile'
# Trigger every Saturday at 12AM GMT
schedule:
- cron: '0 0 * * 6'
# Manually trigger the workflow
workflow_dispatch:
# Stop the workflow if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
docker:
name: 'Build and push Docker container'
runs-on: ubuntu-latest
steps:
- name: 'Check out the repo'
uses: actions/checkout@v4
- name: 'Set up 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 and Push Docker Container'
uses: docker/build-push-action@v5
with:
push: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' }}
no-cache: true
file: 'docker/Dockerfile'
build-args: |
PYGEM_BRANCH=${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
tags: |
ghcr.io/pygem-community/pygem:${{ github.ref == 'refs/heads/master' && 'latest' || github.ref == 'refs/heads/dev' && 'dev' }}