Files
buildpath/.gitea/workflows/pipeline.yaml
vhaudiquet 6e1fb78f8f
Some checks failed
pipeline / build-and-push-images (push) Successful in 14s
pipeline / deploy (push) Has been cancelled
Added environment to pipeline
2025-01-03 19:35:56 +01:00

77 lines
2.3 KiB
YAML

name: pipeline
on:
push:
branches:
- "main"
permissions:
packages: write
jobs:
build-and-push-images:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to container registry
uses: docker/login-action@v3
with:
registry: https://git.vhaudiquet.fr
username: ${{ github.actor }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Build and push frontend docker image
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
tags: |
git.vhaudiquet.fr/vhaudiquet/lolstats-frontend:latest
git.vhaudiquet.fr/vhaudiquet/lolstats-frontend:${{ github.sha }}
- name: Build and push patch_detector docker image
uses: docker/build-push-action@v6
with:
context: ./patch_detector
push: true
tags: |
git.vhaudiquet.fr/vhaudiquet/lolstats-patch_detector:latest
git.vhaudiquet.fr/vhaudiquet/lolstats-patch_detector:${{ github.sha }}
- name: Build and push match_collector docker image
uses: docker/build-push-action@v6
with:
context: ./match_collector
push: true
tags: |
git.vhaudiquet.fr/vhaudiquet/lolstats-match_collector:latest
git.vhaudiquet.fr/vhaudiquet/lolstats-match_collector:${{ github.sha }}
deploy:
runs-on: ubuntu-latest
needs:
- build-and-push-images
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: |
docker-compose.yml
sparse-checkout-cone-mode: false
- name: Docker Stack deploy
uses: leonidgrishenkov/docker-stack-deploy@v1.2.3
with:
registry: https://git.vhaudiquet.fr
username: ${{ github.actor }}
password: ${{ secrets.PACKAGES_TOKEN }}
remote_host: docker-prod.local
remote_user: root
remote_private_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
stack_file: "docker-compose.yml"
stack_name: "lolstats"
env_file: |
GIT_COMMIT_HASH=${{ github.sha }}
RIOT_API_KEY=${{ secrets.RIOT_API_KEY }}