Update CI workflow to use custom Docker image for build and streamline Docker push job
This commit is contained in:
@@ -8,7 +8,7 @@ jobs:
|
||||
build-test:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: golang:1.26
|
||||
image: gitea.jeanlucmakiola.de/makiolaj/docker-node-and-go:latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
@@ -28,25 +28,24 @@ jobs:
|
||||
runs-on: dind
|
||||
needs: build-test
|
||||
if: gitea.event_name == 'push'
|
||||
container:
|
||||
image: docker:cli
|
||||
services:
|
||||
dind:
|
||||
image: docker:dind
|
||||
options: --privileged
|
||||
env:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
env:
|
||||
DOCKER_HOST: tcp://dind:2375
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: apk add --no-cache git
|
||||
- name: Checkout
|
||||
run: |
|
||||
GITEA_HOST="${{ gitea.server_url }}"
|
||||
GITEA_HOST="${GITEA_HOST#https://}"
|
||||
GITEA_HOST="${GITEA_HOST#http://}"
|
||||
git clone "https://oauth2:${{ secrets.GITEA_TOKEN }}@${GITEA_HOST}/${{ gitea.repository }}.git" .
|
||||
git checkout ${{ gitea.sha }}
|
||||
- name: Log in to Gitea registry
|
||||
run: |
|
||||
REGISTRY="${{ gitea.server_url }}"
|
||||
REGISTRY="${REGISTRY#https://}"
|
||||
REGISTRY="${REGISTRY#http://}"
|
||||
echo "${{ secrets.GITEA_TOKEN }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
|
||||
- name: Build and push
|
||||
run: |
|
||||
REGISTRY="${{ gitea.server_url }}"
|
||||
|
||||
Reference in New Issue
Block a user