38 lines
967 B
YAML
38 lines
967 B
YAML
name: Build and Push to Registry
|
|
|
|
on:
|
|
push:
|
|
branches: [ cicd ]
|
|
|
|
env:
|
|
REGISTRY: git.4nkweb.com
|
|
IMAGE_NAME: 4nk/lecoffre-front
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.USER }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
build-args: |
|
|
SSH_PRIVATE_KEY=${{ secrets.SSH_PRIVATE_KEY }}
|
|
ENV_VARS=${{ secrets.ENV_VARS }}
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }} |