Skip to content

Commit d3e939c

Browse files
committed
feat: Add a workflow to build and push to docker registry
1 parent f898f66 commit d3e939c

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to server
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to container reigstry
17+
uses: docker/login-action@v3
18+
with:
19+
registry: docker.sdcmuj.com
20+
username: ${{ vars.DOCKER_USERNAME }}
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Extract metadata (tags, labels) for Docker image
27+
id: meta
28+
uses: docker/metadata-action@v5
29+
with:
30+
images: docker.sdcmuj.com/circon
31+
32+
- name: Build and push docker image
33+
uses: docker/build-push-action@v6
34+
with:
35+
push: true
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.output.labels }}
38+
cache-from: type=registry,ref=docker.sdcmuj.com/circon:buildcache
39+
cache-to: type=registry,ref=docker.sdcmuj.com/circon:buildcache,mode=max
40+

0 commit comments

Comments
 (0)