This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build docker image as artifact for pull requests and commits
Signed-off-by: GitHub <[email protected]>
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains 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
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 |