Skip to content

deploy-image

deploy-image #12

Workflow file for this run

name: deploy-image
on:
workflow_dispatch:
inputs:
image_version:
description: 'Version of the image'
required: true
static_version:
description: 'Static version'
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create .env file
run: |
echo "Creating .env file"
echo "STATIC_VERSION=\"${{ github.event.inputs.static_version }}\"" >> .env
echo "${{ secrets.ENV_FILE_CONTENT }}" >> .env
- name: Move .env file in /web-project/.env
run: mv .env web-project/.env
# Log in to your custom Docker registry
- name: Log in to Docker registry
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY }} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
# Build Docker image inside the correct directory
- name: Build Docker image
run: |
cd web-project/
docker build -t ${{ secrets.DOCKER_REGISTRY }}/archero:v${{ github.event.inputs.image_version }} .
# Push Docker image to the custom registry
- name: Push Docker image
run: docker push ${{ secrets.DOCKER_REGISTRY }}/archero:v${{ github.event.inputs.image_version }}