fix: rewrite CI workflow for proper Gitea Actions syntax
This commit is contained in:
@@ -5,9 +5,12 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- fix-validation-issues
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
REGISTRY: git.danhenry.dev
|
||||
IMAGE_NAME: git.danhenry.dev/thelab/shopping-list-api
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -43,18 +46,15 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Set image name (lowercase)
|
||||
id: meta
|
||||
run: |
|
||||
IMAGE="${{ secrets.DOCKER_REGISTRY }}/${{ toLower(gitea.repository) }}"
|
||||
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Log in to Gitea container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ steps.meta.outputs.image }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Extract commit SHA
|
||||
run: echo "SHA=${GITEA_SHA:0:7}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
uses: docker/build-push-action@v6
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: |
|
||||
${{ steps.meta.outputs.image }}:${{ gitea.sha }}
|
||||
${{ steps.meta.outputs.image }}:latest
|
||||
cache-from: type=registry,ref=${{ steps.meta.outputs.image }}:latest
|
||||
cache-to: type=registry,ref=${{ steps.meta.outputs.image }}:latest,mode=max
|
||||
${{ env.IMAGE_NAME }}:${{ env.SHA }}
|
||||
${{ env.IMAGE_NAME }}:latest
|
||||
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
|
||||
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:latest,mode=max
|
||||
|
||||
Reference in New Issue
Block a user