testing build and test
This commit is contained in:
49
.gitea/workflow/pipeline.yml
Normal file
49
.gitea/workflow/pipeline.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
name: CI/CD Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: home-server
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
cd backend
|
||||
nix-shell -p elixir elixir_ls --run '
|
||||
mix do deps.get, test
|
||||
'
|
||||
|
||||
- name: Build and push backend image
|
||||
run: |
|
||||
cd client
|
||||
docker build -t alexmickelson/elixir-demo-frontend:$GITHUB_BUILD_NUMBER .
|
||||
docker push alexmickelson/elixir-demo-frontend:$GITHUB_BUILD_NUMBER
|
||||
cd ../backend
|
||||
docker build -t alexmickelson/elixir-demo-backend:$GITHUB_BUILD_NUMBER .
|
||||
docker push alexmickelson/elixir-demo-backend:$GITHUB_BUILD_NUMBER
|
||||
|
||||
# - name: Deploy to Kubernetes
|
||||
# run: |
|
||||
# kubectl apply -f kubernetes/namespace.yml
|
||||
# kubectl get secret backend-secret --namespace alex-elixir-demo || \
|
||||
# kubectl create secret generic backend-secret \
|
||||
# --namespace alex-elixir-demo \
|
||||
# --from-literal=cookie=$(openssl rand -hex 32)
|
||||
|
||||
# for file in kubernetes/*.yml; do
|
||||
# cat "$file" | envsubst | kubectl apply -f -
|
||||
# done
|
||||
Reference in New Issue
Block a user