Skip to content

Commit 67c3244

Browse files
authored
Merge pull request #171 from American-Soccer-Analysis/161-add-workflow-for-building-dockerfile
2 parents 2ab7541 + 02fa510 commit 67c3244

File tree

5 files changed

+84
-1
lines changed

5 files changed

+84
-1
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @bgrnwd @tyler-richardett @mattyanselmo @rvino
1+
* @American-Soccer-Analysis/contributors

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"

.github/workflows/docker-ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build Docker Image 🐋
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
- main
7+
paths:
8+
- Dockerfile
9+
workflow_dispatch:
10+
jobs:
11+
docker-build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v6
16+
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v3
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Build
24+
uses: docker/build-push-action@v6
25+
with:
26+
push: false
27+
file: ./Dockerfile
28+
context: .

.github/workflows/docker.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Docker Image 🐋
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
docker:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
packages: write
10+
contents: read
11+
attestations: write
12+
id-token: write
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v6
16+
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Build and push
30+
id: push
31+
uses: docker/build-push-action@v6
32+
with:
33+
push: true
34+
context: .
35+
file: ./Dockerfile
36+
tags: americansocceranalysis/app:latest, americansocceranalysis/app:${{ github.event.release.tag_name }}
37+
38+
- name: Generate artifact attestation
39+
uses: actions/attest-build-provenance@v3
40+
with:
41+
subject-name: index.docker.io/american-soccer-analysis/app
42+
subject-digest: ${{ steps.push.outputs.digest }}
43+
push-to-registry: true

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Match R version in renv.lock
33
FROM rocker/r-ver:4.5.2 AS deps
44
WORKDIR /code
5+
# Install system dependencies
56
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
67
libxml2-dev \
78
libcairo2-dev \
@@ -20,6 +21,7 @@ RUN apt-get update -qq && apt-get -y --no-install-recommends install \
2021
default-jdk \
2122
cmake
2223

24+
# Update all system packages
2325
RUN apt-get update && \
2426
apt-get upgrade -y && \
2527
apt-get clean

0 commit comments

Comments
 (0)