1313 runs-on : self-hosted
1414 steps :
1515 - name : Checkout
16- uses : actions/checkout@v3
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+ fetch-tags : true
1720
1821 - name : Create src directory
1922 run : mkdir src
@@ -39,56 +42,33 @@ jobs:
3942 username : ${{ secrets.DOCKERHUB_USERNAME }}
4043 password : ${{ secrets.DOCKERHUB_TOKEN }}
4144
42- - name : Extract metadata from Git reference
43- id : meta_ogcore
44- uses : docker/metadata-action@v5
45- with :
46- images : |
47- 4teamwork/ogcore
48- flavor : |
49- latest=false
50- tags : |
51- type=pep440,pattern={{version}}
52- type=raw,value=latest,enable=${{ github.ref_type == 'tag' && github.event.base_ref == 'refs/heads/master' }}
53- type=edge,branch=master
45+ - name : Set Git commit env variables
46+ run : |
47+ echo "GIT_TAG=$(git describe --tags --candidates=0)" >> $GITHUB_ENV
48+ echo "GIT_SHA_TAG=$(git describe --tags)" >> $GITHUB_ENV
49+ echo "LATEST_TAG=$(git describe --tags --abbrev=0 origin/master)" >> $GITHUB_ENV
50+ echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
5451
5552 - name : Build and push ogcore
56- uses : docker/build-push-action@v6
53+ uses : docker/bake-action@v6
54+ env :
55+ GITLAB_DEPLOY_TOKEN : ${{ secrets.GITLAB_DEPLOY_TOKEN }}
5756 with :
58- context : .
59- file : ./ docker/core/Dockerfile
60- platforms : ${{ github.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
57+ source : .
58+ files : docker-bake.hcl
59+ targets : ogcore
6160 push : true
62- tags : ${{ steps.meta_ogcore.outputs.tags }}
63- labels : ${{ steps.meta_ogcore.outputs.labels }}
64- cache-from : type=gha,scope=ogcore
65- cache-to : type=gha,mode=max,scope=ogcore
66- secrets : |
67- "gldt=${{ secrets.GITLAB_DEPLOY_TOKEN }}"
68-
69- - name : Extract metadata from Git reference for ogtestserver
70- id : meta_ogtestserver
71- uses : docker/metadata-action@v5
72- with :
73- images : |
74- 4teamwork/ogtestserver
75- flavor : |
76- latest=false
77- tags : |
78- type=pep440,pattern={{version}}
79- type=raw,value=latest,enable=${{ github.ref_type == 'tag' && github.event.base_ref == 'refs/heads/master' }}
80- type=edge,branch=master
61+ set : |
62+ *.secrets=id=gldt,env=GITLAB_DEPLOY_TOKEN
8163
8264 - name : Build and push ogtestserver
83- uses : docker/build-push-action@v6
65+ uses : docker/bake-action@v6
66+ env :
67+ GITLAB_DEPLOY_TOKEN : ${{ secrets.GITLAB_DEPLOY_TOKEN }}
8468 with :
85- context : .
86- file : ./ docker/testserver/Dockerfile
87- platforms : ${{ github.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
69+ source : .
70+ files : docker-bake.hcl
71+ targets : ogtestserver
8872 push : true
89- tags : ${{ steps.meta_ogtestserver.outputs.tags }}
90- labels : ${{ steps.meta_ogtestserver.outputs.labels }}
91- cache-from : type=gha,scope=ogtestserver
92- cache-to : type=gha,mode=max,scope=ogtestserver
93- secrets : |
94- "gldt=${{ secrets.GITLAB_DEPLOY_TOKEN }}"
73+ set : |
74+ *.secrets=id=gldt,env=GITLAB_DEPLOY_TOKEN
0 commit comments