Skip to content

Change Docker build to include static files directly in calendaronlin… #13

Change Docker build to include static files directly in calendaronlin…

Change Docker build to include static files directly in calendaronlin… #13

Workflow file for this run

name: Release Action
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Standart Checkout
uses: actions/checkout@v4
- name: Set Version Number
run: |
echo "VERSION_NUMBER=$(echo "${{ github.ref }}" | sed 's#refs/tags/v##')" >> $GITHUB_ENV
echo "DOCKER_APP_IMAGE=calendaronline" >> $GITHUB_ENV
echo "DOCKER_NGINX_IMAGE=calendaronline-nginx" >> $GITHUB_ENV
echo "DOCKER_APP_TAG=ghcr.io/dpmpc/calendaronline" >> $GITHUB_ENV
echo "DOCKER_NGINX_TAG=ghcr.io/dpmpc/calendaronline-nginx" >> $GITHUB_ENV
shell: bash
- name: Build Docker Nginx Image
run: |
cd nginx
mv ../web/creator/static .
docker build -t ${{ env.DOCKER_NGINX_IMAGE }} .
docker tag ${{ env.DOCKER_NGINX_IMAGE }} ${{ env.DOCKER_NGINX_TAG}}:latest
docker tag ${{ env.DOCKER_NGINX_IMAGE }} ${{ env.DOCKER_NGINX_TAG}}:${{ env.VERSION_NUMBER }}
- name: Build Docker App Image
run: |
cd web
docker build -t ${{ env.DOCKER_APP_IMAGE }} .
docker tag ${{ env.DOCKER_APP_IMAGE }} ${{ env.DOCKER_APP_TAG}}:latest
docker tag ${{ env.DOCKER_APP_IMAGE }} ${{ env.DOCKER_APP_TAG}}:${{ env.VERSION_NUMBER }}
- name: Push Docker Images
run: |
docker login -u $GITHUB_REPOSITORY_OWNER -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
docker push -a ${{ env.DOCKER_APP_TAG }}
docker push -a ${{ env.DOCKER_NGINX_TAG }}