Skip to content

🐳 Docker build

🐳 Docker build #132

Workflow file for this run

name: 🐳 Docker build
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'develop'
paths:
- 'src/**'
- '.env'
- 'index.html'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Login to docker registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- id: repo_name
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
string: ${{ github.repository_owner }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ secrets.REGISTRY_URL }}/${{ steps.repo_name.outputs.lowercase }}/teia-ui:${{ github.ref_name }}
context: .
file: ./.github/workflows/Dockerfile
- name: Restart containers
run: |
curl -H "Authorization: Bearer ${{ secrets.WEBHOOK_TOKEN }}" "${{ secrets.WEBHOOK_URL }}"
- name: Check deployed prod version
if: github.ref == 'refs/heads/main'
run: |
sleep 10; curl -Is "${{ vars.WEBSITE_URL }}" | grep "x-teia-commit-hash: ${{ github.sha }}"
- name: Check deployed preview version
if: github.ref == 'refs/heads/develop'
run: |
sleep 10; curl -Is "${{ vars.WEBSITE_PREVIEW_URL }}" | grep "x-teia-commit-hash: ${{ github.sha }}"