Registry Workflow #20
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
| name: Registry Workflow | |
| run-name: Registry Workflow | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| required: true | |
| env: | |
| REGISTRY: ghcr.io | |
| DOCKER_USER: 1001:127 | |
| jobs: | |
| build-and-push-backend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - | |
| name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - | |
| name: Log in to the container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| target: backend-production | |
| build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 | |
| push: true | |
| tags: ${{ env.REGISTRY }}/cozy/impress-backend:${{ github.event.inputs.tag }} | |
| build-and-push-frontend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - | |
| name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - | |
| name: Log in to the container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./src/frontend/Dockerfile | |
| target: frontend-production | |
| build-args: | | |
| DOCKER_USER=${{ env.DOCKER_USER }}:-1000 | |
| PUBLISH_AS_MIT=false | |
| push: true | |
| tags: ${{ env.REGISTRY }}/cozy/impress-frontend:${{ github.event.inputs.tag }} |