deploy-image #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |