-
Notifications
You must be signed in to change notification settings - Fork 52
64 lines (53 loc) · 1.69 KB
/
docker_pygem.yml
File metadata and controls
64 lines (53 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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' }}