Skip to content

Commit

Permalink
add build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
coutug committed Oct 2, 2024
1 parent c4d5085 commit 7109011
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: build images
on:
push:
tags:
- "v*"
branches:
- "main"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=,suffix=-{{date 'X'}}
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=develop
type=semver,pattern={{raw}}
- name: test image names
run: echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend${{ steps.meta.outputs.tags }}"

# - name: Build and push frontend Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./frontend
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
#
# - name: Build and push backend Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./backend
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 7109011

Please sign in to comment.