Skip to content

Commit

Permalink
feat(dc/di): update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Apr 23, 2024
1 parent 8277616 commit 7e6d8cc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
38 changes: 16 additions & 22 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,37 @@ jobs:

- name: 🪚 Build app
run: |
cd client
npm ci
npm run build -- --mode staging
- name: 🏷️ Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT

- name: 🔑 Login Docker
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: 🐳 Build Docker image
run: |
cd client
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=ghcr.io/dataesr/ticket-office
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker build -f Dockerfile -t $IMAGE_ID:${{ steps.tag.outputs.tag }} .
docker build -t $IMAGE_ID:staging .
- name: 📦 Push Docker image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=ghcr.io/dataesr/ticket-office
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker push --all-tags $IMAGE_ID
deploy:
name: 💭 Update staging deployment
runs-on: ubuntu-latest
needs: publish-ghcr
steps:
- name: Deploy to Cluster
id: kubectl-deploy
uses: dataesr/[email protected]
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DOAD_STAGING }}
with:
namespace: ${{ env.DEPLOYMENT_NAMESPACE }}
restart: ${{ env.DEPLOYMENT }}
# deploy:
# name: 💭 Update staging deployment
# runs-on: ubuntu-latest
# needs: publish-ghcr
# steps:
# - name: Deploy to Cluster
# id: kubectl-deploy
# uses: dataesr/[email protected]
# env:
# KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DOAD_STAGING }}
# with:
# namespace: ${{ env.DEPLOYMENT_NAMESPACE }}
# restart: ${{ env.DEPLOYMENT }}

notify:
name: 📢 Notify in mattermost channel
Expand Down
10 changes: 4 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
version: "3.8"

services:
app:
image: node:18-alpine
image: ghcr.io/dataesr/ticket-office
working_dir: /app
volumes:
- .:/app

ports:
- "3000:3000"
- "5173:5173"

environment:
- NODE_ENV=staging
- VITE_SCANR_API_AUTORIZATION=${VITE_SCANR_API_AUTORIZATION}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "scanR-contact-v2",
"name": "ticket-office",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down

0 comments on commit 7e6d8cc

Please sign in to comment.