chore(ci/cd): Migrated CI/CD to Gitea Act
This commit is contained in:
31
.gitea/workflows/dev.yml
Normal file
31
.gitea/workflows/dev.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.phorge.fr
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ github.ref_name }}
|
||||||
|
SHORT_HASH: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
# Build the image with the commit hash tag
|
||||||
|
docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t git.phorge.fr/retake/retake.fr:${SHORT_HASH:0:5} --target server -f .devops/rocm.Dockerfile .
|
||||||
|
|
||||||
|
# Tag the same image as "latest"
|
||||||
|
docker tag git.phorge.fr/retake/retake.fr:$${SHORT_HASH:0:5} git.phorge.fr/retake/retake.fr:latest
|
||||||
43
.gitea/workflows/main.yml
Normal file
43
.gitea/workflows/main.yml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.phorge.fr
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ github.ref_name }}
|
||||||
|
SHORT_HASH: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
# Build the image with the commit hash tag
|
||||||
|
docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t git.phorge.fr/retake/retake.fr:${SHORT_HASH:0:5} --target server -f .devops/rocm.Dockerfile .
|
||||||
|
|
||||||
|
# Tag the same image as "latest"
|
||||||
|
docker tag git.phorge.fr/retake/retake.fr:$${SHORT_HASH:0:5} git.phorge.fr/retake/retake.fr:latest
|
||||||
|
|
||||||
|
- name: Push Docker Images
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ github.ref_name }}
|
||||||
|
SHORT_HASH: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
docker push git.phorge.fr/retake/retake.fr:${SHORT_HASH:0:5}
|
||||||
|
docker push git.phorge.fr/retake/retake.fr:latest
|
||||||
|
|
||||||
|
- name: Log out from registry
|
||||||
|
if: always()
|
||||||
|
run: docker logout git.phorge.fr
|
||||||
27
.github/workflows/dev.yml
vendored
27
.github/workflows/dev.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
name: Docker Build for Dev Branch
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- ".gitignore"
|
|
||||||
- "README.md"
|
|
||||||
- "LICENSE"
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: false
|
|
||||||
tags: website:dev
|
|
||||||
34
.github/workflows/main.yml
vendored
34
.github/workflows/main.yml
vendored
@@ -1,34 +0,0 @@
|
|||||||
name: Docker Build and Push for Main Branch
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- ".gitignore"
|
|
||||||
- "README.md"
|
|
||||||
- "LICENSE"
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ${{ secrets.REGISTRY_URL }}
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: ${{ secrets.REGISTRY_URL }}/website:latest
|
|
||||||
Reference in New Issue
Block a user