Create Github Release - 3.0.0-beta18 #18
Workflow file for this run
This file contains hidden or 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
| # This workflow builds a GitHub release on tag creation and then builds and | |
| # pushes Docker images to GitHub Container Registry. | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| name: Create Github Release | |
| run-name: "Create Github Release - ${{ github.head_ref || github.ref_name }}" | |
| env: | |
| COMPOSE_USER: runner | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup docker network | |
| run: | | |
| docker network create frontend | |
| - name: Install dependencies with composer | |
| run: | | |
| docker compose run --rm --env APP_ENV=prod phpfpm composer install --no-dev -o --classmap-authoritative | |
| docker compose run --rm --env APP_ENV=prod phpfpm composer clear-cache | |
| - name: Installs node dependencies with npm | |
| run: | | |
| docker compose run --rm node npm install | |
| docker compose run --rm node npm run build | |
| - name: Cleanup after install | |
| run: | | |
| sudo chown -R runner:runner . | |
| rm -rf docs | |
| rm -rf infrastructure | |
| rm -rf fixtures | |
| rm -rf tests | |
| rm -rf node_modules | |
| - name: Make assets dir | |
| run: | | |
| mkdir -p ../assets | |
| - name: Create archive | |
| run: | | |
| tar -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./* | |
| - name: Create checksum | |
| run: sha256sum ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt | |
| - name: Create a release in GitHub and uploads assets | |
| run: | | |
| gh release create ${{ github.ref_name }} --verify-tag --generate-notes ${{ steps.prerelease.outputs.flag }} ../assets/*.* | |
| env: | |
| GITHUB_TOKEN: ${{ github.TOKEN }} | |
| shell: bash | |
| images: | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME_MAIN: ${{ github.repository }} | |
| IMAGE_NAME_NGINX: ${{ github.repository }}-nginx | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Build main | |
| - name: Docker meta (main) | |
| id: meta-main | |
| uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_MAIN }} | |
| tags: | | |
| type=raw,value=${{ github.ref_name }} | |
| - name: Build and push Docker image (main) | |
| id: push-main | |
| uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
| with: | |
| context: . | |
| file: ./infrastructure/display-api-service/Dockerfile | |
| build-args: | | |
| APP_VERSION=${{ github.ref_name }} | |
| push: true | |
| tags: ${{ steps.meta-main.outputs.tags }} | |
| labels: ${{ steps.meta-main.outputs.labels }} | |
| sbom: true | |
| # Build Nginx (depends on main) | |
| - name: Docker meta (nginx) | |
| id: meta-nginx | |
| uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_NGINX }} | |
| tags: | | |
| type=raw,value=${{ github.ref_name }} | |
| - name: Build and push Docker image (nginx) | |
| id: push-nginx | |
| uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
| with: | |
| context: ./infrastructure/nginx/ | |
| file: ./infrastructure/nginx/Dockerfile | |
| build-args: | | |
| APP_VERSION=${{ github.ref_name }} | |
| APP_IMAGE=${{ env.IMAGE_NAME_MAIN }} | |
| push: true | |
| pull: true | |
| tags: ${{ steps.meta-nginx.outputs.tags }} | |
| labels: ${{ steps.meta-nginx.outputs.labels }} | |
| sbom: true |