name: Jan CI Production on: push: tags: ['v*.*.*'] env: REGISTRY: ghcr.io HASURA_WORKER_IMAGE_NAME: ${{ github.repository }}/worker WEB_CLIENT_IMAGE_NAME: ${{ github.repository }}/web-client jobs: build-docker-image: runs-on: ubuntu-latest environment: production permissions: contents: read packages: write steps: - name: Getting the repo uses: actions/checkout@v3 - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Get tag id: tag uses: dawidd6/action-get-tag@v1 # Build and docker image for app-backend worker - name: Build docker image for app-backend worker run: | cd ./app-backend/worker docker build -t ${{ env.REGISTRY }}/${{ env.HASURA_WORKER_IMAGE_NAME }}:${{ steps.tag.outputs.tag }} . docker push ${{ env.REGISTRY }}/${{ env.HASURA_WORKER_IMAGE_NAME }}:${{ steps.tag.outputs.tag }} # Get .env for FE - name: Get .env file for build time run: cd ./web-client && base64 -d <<< "$ENV_FILE_BASE64" > .env shell: bash env: ENV_FILE_BASE64: ${{ secrets.ENV_FILE_BASE64 }} # Build and push docker for web client - name: Build docker image for web-client run: | cd ./web-client docker build -t ${{ env.REGISTRY }}/${{ env.WEB_CLIENT_IMAGE_NAME }}:${{ steps.tag.outputs.tag }} . docker push ${{ env.REGISTRY }}/${{ env.WEB_CLIENT_IMAGE_NAME }}:${{ steps.tag.outputs.tag }}