Skip to content

Commit 7cee70a

Browse files
committed
add workflow for sas as container
1 parent 95009b4 commit 7cee70a

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/container.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
tags:
8+
- 'v*'
9+
branches:
10+
- 'main'
11+
- 'test_docker_push'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-and-push:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
with:
28+
platforms: all
29+
30+
- name: Docker meta
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: |
35+
${{ secrets.CONTAINER_REPO }}
36+
tags: |
37+
type=ref,event=branch
38+
type=semver,pattern={{version}}
39+
type=semver,pattern={{major}}.{{minor}}
40+
type=sha
41+
# set latest tag for default branch
42+
type=raw,value=latest,enable={{is_default_branch}}
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
46+
- name: Log in to Docker Hub
47+
uses: docker/login-action@v3
48+
with:
49+
username: ${{ secrets.DOCKER_USERNAME }}
50+
password: ${{ secrets.DOCKER_PAT }}
51+
52+
- name: Build and push Docker image
53+
uses: docker/build-push-action@v6
54+
with:
55+
context: 'docker/sas-tomcat'
56+
file: Dockerfile
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)