Skip to content

Commit d425505

Browse files
Merge pull request #16 from miguelcarcamov/development
ADD: adding workflow to create container image when tagging
2 parents 2a39358 + ca1bf56 commit d425505

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: build-tagged-container
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
env:
8+
REGISTRY: ghcr.io
9+
10+
jobs:
11+
build-tagged-container:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Get tag
15+
id: tag
16+
uses: dawidd6/action-get-tag@v1
17+
with:
18+
# Optionally strip `v` prefix
19+
strip_v: true
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v1
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.repository_owner }}
27+
password: ${{ secrets.REGISTRY_TOKEN }}
28+
- name: Build and Push Docker Image
29+
uses: docker/build-push-action@v5
30+
with:
31+
file: ./Dockerfile.prod
32+
push: true # Will only build if this is not here
33+
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{steps.tag.outputs.tag}}
34+
secrets: |
35+
"BRANCH_NAME=${{ github.head_ref || github.ref_name }}"

0 commit comments

Comments
 (0)