Compare commits
No commits in common. "e5a8e74365257e49c747ff4feb291d5750961655" and "c8cb561df5460bc5e23109283d1069f216a38fe0" have entirely different histories.
e5a8e74365
...
c8cb561df5
1 changed files with 22 additions and 6 deletions
|
|
@ -7,6 +7,10 @@ on:
|
|||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
REGISTRY: ${{ forgejo.server_url }}
|
||||
IMAGE_NAME: ${{ forgejo.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
|
|
@ -14,9 +18,21 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Build and publish image
|
||||
uses: http://forgejo:3000/andras/ci-actions/docker-publish@main
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
token: ${{ secrets.FORGEJO_TOKEN }}
|
||||
- name: Log into registry
|
||||
if: forgejo.event_name != 'pull_request'
|
||||
run: echo "${{ secrets.FORGEJO_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ forgejo.actor }} --password-stdin
|
||||
|
||||
- name: Build Docker image
|
||||
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 }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue