Skip to content

Merge branch 'main' of https://github.com/ClubCedille/hackqc2024 #126

Merge branch 'main' of https://github.com/ClubCedille/hackqc2024

Merge branch 'main' of https://github.com/ClubCedille/hackqc2024 #126

Workflow file for this run

name: Build and Push Docker Images
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io/clubcedille
jobs:
build-and-push:
runs-on: ubuntu-latest
environment:
name: Kubernetes CEDILLE
url: https://hackqc2024.omni.cedille.club
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/hackqc2024:commit-${{ github.sha }}
${{ env.REGISTRY }}/hackqc2024:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Refresh Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Update version with kustomize
run: |
cd k8s
kustomize edit set image ghcr.io/clubcedille/hackqc2024:commit-${{ github.sha }}
- name: Commit changes
uses: EndBug/[email protected]
with:
author_name: GitHub Action
author_email: [email protected]
message: 'Update version with kustomize'
add: 'k8s/kustomization.yaml'
pull: ' '
- name: Refresh ArgoCD
run: |
curl -X POST -H 'Content-type: application/json' -H 'X-GitHub-Event:push' -d '{"ref": "","repository": {"html_url":"https://github.com/ClubCedille/hackqc2024"}}' https://argocd.omni.cedille.club/api/webhook