Skip to content

Commit 93c7bb3

Browse files
committed
chore: GitHub Build Docker Image
* On PR, ensure that the Docker image can be build * On push into main, build and push the docker image as an unstable version * On tagging, tag the docker image with a release tag
1 parent f213b76 commit 93c7bb3

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/on-pr.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,15 @@ jobs:
112112
with:
113113
name: cypress-videos
114114
path: cypress/videos
115+
116+
docker-build:
117+
runs-on: ubuntu-latest
118+
steps:
119+
- name: Checkout Repository
120+
uses: actions/checkout@v3
121+
with:
122+
ref: ${{ github.event.pull_request.head.ref }}
123+
- name: Verify Build Works
124+
uses: docker/build-push-action@v3
125+
with:
126+
push: false
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Handle Push to Main
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
name: Build And Push to Docker Hub
11+
steps:
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v2
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v2
17+
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v2
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
24+
- name: Build and push
25+
uses: docker/build-push-action@v3
26+
with:
27+
push: true
28+
tags: hicsail/signlab:unstable

.github/workflows/on-release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release Actions
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
name: Build And Push to Docker Hub
11+
steps:
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v2
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v2
17+
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v2
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
24+
- name: Build and push
25+
uses: docker/build-push-action@v3
26+
with:
27+
push: true
28+
tags: hicsail/signlab:${{github.ref_name}},hicsail/signlab:latest

0 commit comments

Comments
 (0)