mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
feat(infrastructure): automatic deploy
This commit is contained in:
54
.github/workflows/workflow.yml
vendored
54
.github/workflows/workflow.yml
vendored
@@ -1,54 +0,0 @@
|
|||||||
name: Build, Push and Update Image in Manifest
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
paths:
|
|
||||||
- '7project/backend/**'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-update:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: build
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./7project/backend
|
|
||||||
push: true
|
|
||||||
tags: ${{ secrets.DOCKER_USER }}/cc-app-demo:latest
|
|
||||||
|
|
||||||
- name: Get image digest
|
|
||||||
run: echo "IMAGE_DIGEST=${{ steps.build.outputs.digest }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
#- name: Update manifests with new image digest
|
|
||||||
# uses: OpsVerseIO/image-updater-action@0.1.0
|
|
||||||
# with:
|
|
||||||
# branch: main
|
|
||||||
# targetBranch: main
|
|
||||||
# createPR: 'false'
|
|
||||||
# message: "${{ github.event.head_commit.message }}"
|
|
||||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# changes: |
|
|
||||||
# {
|
|
||||||
# "deployment/app-demo-deployment.yaml": {
|
|
||||||
# "spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
|
||||||
# },
|
|
||||||
# "deployment/app-demo-worker-deployment.yaml": {
|
|
||||||
# "spec.template.spec.containers[0].image": "${{ secrets.DOCKER_USER }}/cc-app-demo@${{ env.IMAGE_DIGEST }}"
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
Reference in New Issue
Block a user