Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
ci: build docker image as artifact for pull requests and commits
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
ferferga committed Dec 13, 2023
1 parent 92ee05d commit 20825ed
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,40 @@ jobs:

- name: Perform tests ⚒️
run: python ./manage.py test

build:
name: Build Docker image 📦
runs-on: ubuntu-latest

steps:
- name: Checkout ⬇️
uses: actions/[email protected]
with:
show-progress: false

- name: Configure QEMU ⚙️
uses: docker/[email protected]

- name: Configure Docker Buildx ⚙️
uses: docker/[email protected]

- name: Build Docker images 🛠️
uses: docker/[email protected]
with:
context: .
file: Dockerfile
platforms: linux/amd64
load: true
tags: |
traineerbook
- name: Extract Docker image for artifact publishing 📦
run: |
docker save traineerbook > docker_image.tar.gz
- name: Upload artifact (Docker image) ⬆️📦
uses: actions/[email protected]
with:
name: docker_image
path: |
docker_image.tar.gz
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release 📲

on:
push:
branches:
- master
paths-ignore:
- "**/*.md"

jobs:
docker:
name: Build Docker images 💿💻
runs-on: ubuntu-latest

steps:
- name: Checkout ⬇️
uses: actions/[email protected]
with:
show-progress: false

- name: Configure QEMU ⚙️
uses: docker/[email protected]

- name: Configure Docker Buildx ⚙️
uses: docker/[email protected]

- name: Login to GitHub Container Registry 🔑
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PUSH_TOKEN }}

- name: Build and push stable images 🛠️⬆️
uses: docker/[email protected]
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
traineerbook:latest
ghcr.io/us-ferferga/traineerbook:latest
- name: Extract Docker image for artifact publishing 📦
run: |
docker save traineerbook > docker_image.tar.gz
- name: Upload artifact (Docker image) ⬆️📦
uses: actions/[email protected]
with:
name: docker_image
path: |
docker_image.tar.gz

0 comments on commit 20825ed

Please sign in to comment.