Compare commits

..

No commits in common. "e5a8e74365257e49c747ff4feb291d5750961655" and "c8cb561df5460bc5e23109283d1069f216a38fe0" have entirely different histories.

View file

@ -7,6 +7,10 @@ on:
pull_request: pull_request:
branches: [ "main" ] branches: [ "main" ]
env:
REGISTRY: ${{ forgejo.server_url }}
IMAGE_NAME: ${{ forgejo.repository }}
jobs: jobs:
build: build:
runs-on: docker runs-on: docker
@ -14,9 +18,21 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: https://code.forgejo.org/actions/checkout@v4 uses: https://code.forgejo.org/actions/checkout@v4
- name: Build and publish image - name: Log into registry
uses: http://forgejo:3000/andras/ci-actions/docker-publish@main if: forgejo.event_name != 'pull_request'
with: run: echo "${{ secrets.FORGEJO_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ forgejo.actor }} --password-stdin
context: .
push: ${{ github.event_name != 'pull_request' }} - name: Build Docker image
token: ${{ secrets.FORGEJO_TOKEN }} run: |
TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
if [ "${{ forgejo.ref_type }}" = "tag" ]; then
VERSION="${{ forgejo.ref_name }}"
docker build -t "$TAG" -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}" .
else
docker build -t "$TAG" .
fi
- name: Push Docker image
if: forgejo.event_name != 'pull_request'
run: |
docker push --all-tags "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"