Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
7c8bfad01f
|
|||
4821316ee9
|
|||
798cd355b2
|
|||
eab152e928
|
|||
60e7136bcd
|
|||
99b5401c38
|
|||
b6c133bb54
|
|||
58a1a8ee2f
|
|||
bbeebda027
|
|||
267ec22c6f
|
|||
a95bf7a43e
|
|||
20de0927da
|
@@ -11,50 +11,26 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: dind
|
name: Build image
|
||||||
env:
|
runs-on: ubuntu-22.04
|
||||||
REGISTRY: hub.realmanual.ru
|
container: catthehacker/ubuntu:act-latest
|
||||||
IMAGE_NAME: pub/sqlite-backup/backup
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (git)
|
- name: Checkout repository
|
||||||
shell: bash
|
uses: actions/checkout@v4
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
: "${GITHUB_SERVER_URL:?}"
|
|
||||||
: "${GITHUB_REPOSITORY:?}"
|
|
||||||
: "${GITHUB_SHA:?}"
|
|
||||||
git init .
|
|
||||||
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
|
||||||
git -c http.extraHeader="Authorization: Bearer ${TOKEN}" fetch --no-tags --depth=1 origin "${GITHUB_SHA}"
|
|
||||||
git checkout --detach "${GITHUB_SHA}"
|
|
||||||
|
|
||||||
- name: Extract tag
|
- name: Log in to the Container registry
|
||||||
id: vars
|
uses: docker/login-action@v3
|
||||||
shell: bash
|
with:
|
||||||
run: |
|
registry: git.realmanual.ru
|
||||||
TAG_REF="${GITHUB_REF#refs/tags/}"
|
username: ${{ gitea.actor }}
|
||||||
echo "tag=$TAG_REF" >> "$GITHUB_OUTPUT"
|
password: ${{ secrets.PUSH_TOKEN }}
|
||||||
|
|
||||||
- name: Docker login
|
- name: Build and push Docker image
|
||||||
shell: bash
|
id: push
|
||||||
run: |
|
uses: docker/build-push-action@v6
|
||||||
set -euo pipefail
|
with:
|
||||||
echo "${{ secrets.GITEA_TOKEN }}" | docker login "${{ env.REGISTRY }}" --username "${{ github.actor }}" --password-stdin
|
context: .
|
||||||
|
push: true
|
||||||
- name: Build image
|
tags: |
|
||||||
shell: bash
|
${{ gitea.registry }}/${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||||
run: |
|
${{ gitea.registry }}/${{ gitea.repository }}:latest
|
||||||
set -euo pipefail
|
|
||||||
docker build \
|
|
||||||
-t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}" \
|
|
||||||
-t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push images
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}"
|
|
||||||
docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
|
|
||||||
|
Reference in New Issue
Block a user