ci: migrate from ghcr.io to Gitea registry (CAR-995) #21

Closed
Barcode Betty wants to merge 1 commits from cs_betty/api:barcode-betty/car-995-gitea-registry-v2 into dev
+6 -12
View File
@@ -15,7 +15,7 @@ permissions:
packages: write packages: write
env: env:
REGISTRY: ghcr.io REGISTRY: git.farh.net
IMAGE_NAME: cartsnitch/api IMAGE_NAME: cartsnitch/api
jobs: jobs:
@@ -53,9 +53,6 @@ jobs:
services: services:
postgres: postgres:
image: postgres:15-alpine image: postgres:15-alpine
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
env: env:
POSTGRES_USER: cartsnitch POSTGRES_USER: cartsnitch
POSTGRES_PASSWORD: cartsnitch_test POSTGRES_PASSWORD: cartsnitch_test
@@ -69,9 +66,6 @@ jobs:
--health-retries 5 --health-retries 5
redis: redis:
image: redis:7-alpine image: redis:7-alpine
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
ports: ports:
- 6379:6379 - 6379:6379
options: >- options: >-
@@ -129,13 +123,13 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GHCR - name: Log in to Gitea Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITEA_TOKEN }}
- name: Extract metadata - name: Extract metadata
id: meta id: meta
@@ -225,7 +219,7 @@ jobs:
if: needs.build-and-push.result == 'success' if: needs.build-and-push.result == 'success'
run: | run: |
cd infra/apps/overlays/dev cd infra/apps/overlays/dev
kustomize edit set image ghcr.io/cartsnitch/api:${{ steps.api_tag.outputs.tag }} kustomize edit set image git.farh.net/cartsnitch/api:${{ steps.api_tag.outputs.tag }}
- name: Commit and push to infra - name: Commit and push to infra
run: | run: |
@@ -269,7 +263,7 @@ jobs:
if: needs.build-and-push.result == 'success' if: needs.build-and-push.result == 'success'
run: | run: |
cd infra/apps/overlays/uat cd infra/apps/overlays/uat
kustomize edit set image ghcr.io/cartsnitch/api:${{ steps.api_tag.outputs.tag }} kustomize edit set image git.farh.net/cartsnitch/api:${{ steps.api_tag.outputs.tag }}
- name: Commit and push to infra - name: Commit and push to infra
run: | run: |