Skip to content

Commit

Permalink
Merge pull request #16 from miguelcarcamov/development
Browse files Browse the repository at this point in the history
ADD: adding workflow to create container image when tagging
  • Loading branch information
miguelcarcamov authored May 8, 2024
2 parents 2a39358 + ca1bf56 commit d425505
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build_tagged_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build-tagged-container

on:
push:
tags:
- '*'
env:
REGISTRY: ghcr.io

jobs:
build-tagged-container:
runs-on: ubuntu-latest
steps:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
# Optionally strip `v` prefix
strip_v: true
- name: Checkout Code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.prod
push: true # Will only build if this is not here
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{steps.tag.outputs.tag}}
secrets: |
"BRANCH_NAME=${{ github.head_ref || github.ref_name }}"

0 comments on commit d425505

Please sign in to comment.