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:
|
build-test:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: golang:1.26
|
image: gitea.jeanlucmakiola.de/makiolaj/docker-node-and-go:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
@@ -28,25 +28,24 @@ jobs:
|
|||||||
runs-on: dind
|
runs-on: dind
|
||||||
needs: build-test
|
needs: build-test
|
||||||
if: gitea.event_name == 'push'
|
if: gitea.event_name == 'push'
|
||||||
container:
|
|
||||||
image: docker:cli
|
|
||||||
services:
|
|
||||||
dind:
|
|
||||||
image: docker:dind
|
|
||||||
options: --privileged
|
|
||||||
env:
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
env:
|
env:
|
||||||
DOCKER_HOST: tcp://dind:2375
|
DOCKER_HOST: tcp://dind:2375
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Install dependencies
|
||||||
uses: actions/checkout@v6
|
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
|
- name: Log in to Gitea registry
|
||||||
run: |
|
run: |
|
||||||
REGISTRY="${{ gitea.server_url }}"
|
REGISTRY="${{ gitea.server_url }}"
|
||||||
REGISTRY="${REGISTRY#https://}"
|
REGISTRY="${REGISTRY#https://}"
|
||||||
REGISTRY="${REGISTRY#http://}"
|
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
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
REGISTRY="${{ gitea.server_url }}"
|
REGISTRY="${{ gitea.server_url }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user