30 lines
800 B
YAML
30 lines
800 B
YAML
name: Docker Image Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get tag name
|
|
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
- name: Login to Docker Hub
|
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
IMAGE_NAME=creations/profile-page
|
|
docker build --target release -t $IMAGE_NAME:${{ env.TAG }} -t $IMAGE_NAME:latest .
|
|
|
|
- name: Push Docker image
|
|
run: |
|
|
IMAGE_NAME=creations/profile-page
|
|
docker push $IMAGE_NAME:${{ env.TAG }}
|
|
docker push $IMAGE_NAME:latest
|