Skip to content

Build and Deploy Docker Image #42

Build and Deploy Docker Image

Build and Deploy Docker Image #42

name: Build and Deploy Docker Image
on:
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Checkout framelix repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Create .env file
run: cp dev-scripts/.env_git_tests dev-scripts/.env
- name: Build and deploy image
run: bash dev-scripts/docker-hub.sh -v "${{ github.ref_name }}" -p
- name: Upload userdata after deploy
if: always()
uses: actions/upload-artifact@v3
with:
name: userdata-after-phpunit
path: ./userdata
retention-days: 5
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
with:
dest: './logs'
- name: Upload docker logs to GitHub
if: always()
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: ./logs
retention-days: 5