change workflow script
This commit is contained in:
parent
2514632d3b
commit
f71f796a58
@ -11,8 +11,9 @@ jobs:
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
REGISTRY: registry.tuxnet.lan
|
||||
REGISTRY: git.cooltux.net
|
||||
IMAGE: db/pg_dump
|
||||
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@ -24,16 +25,29 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with: # replace it with your local IP
|
||||
config-inline: |
|
||||
[registry."registry.tuxnet.lan"]
|
||||
http = true
|
||||
insecure = true
|
||||
[registry."git.cooltux.net"]
|
||||
http = false
|
||||
insecure = false
|
||||
|
||||
- name: Set Docker Version
|
||||
id: get_version
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }} # replace it with your local IP
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
DOCKER_VERSION=$(grep -oP '(?<=^ARG VERSION=).*' Dockerfile)
|
||||
echo "Docker version: $DOCKER_VERSION"
|
||||
echo "::set-output name=tag::$DOCKER_VERSION"
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||
|
||||
# - name: Set Docker Version
|
||||
# id: get_version
|
||||
# run: |
|
||||
# DOCKER_VERSION=$(grep -oP '(?<=^ARG VERSION=).*' Dockerfile)
|
||||
# echo "Docker version: $DOCKER_VERSION"
|
||||
# echo "::set-output name=tag::$DOCKER_VERSION"
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
@ -43,4 +57,6 @@ jobs:
|
||||
platforms: |
|
||||
linux/amd64
|
||||
push: false
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.get_version.outputs.tag }}
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
|
||||
${{ env.REGISTRY }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user